dos2unix on the whole repo
This commit is contained in:
parent
c80efac7de
commit
f2cbde50ca
27 changed files with 28661 additions and 28661 deletions
|
@ -1,28 +1,28 @@
|
|||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// the compiled file.
|
||||
//
|
||||
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
||||
// GO AFTER THE REQUIRES BELOW.
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery-ui
|
||||
//= require jquery_ujs
|
||||
//= require ./orderedLibraries/underscore
|
||||
//= require ./orderedLibraries/backbone
|
||||
//= require_directory ./lib
|
||||
//= require ./src/Metamaps.GlobalUI
|
||||
//= require ./src/Metamaps.Router
|
||||
//= require ./src/Metamaps.Backbone
|
||||
//= require ./src/Metamaps.Views
|
||||
//= require ./src/JIT
|
||||
//= require ./src/Metamaps
|
||||
//= require ./src/Metamaps.JIT
|
||||
//= require_directory ./shims
|
||||
//= require_directory ./require
|
||||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// the compiled file.
|
||||
//
|
||||
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
||||
// GO AFTER THE REQUIRES BELOW.
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery-ui
|
||||
//= require jquery_ujs
|
||||
//= require ./orderedLibraries/underscore
|
||||
//= require ./orderedLibraries/backbone
|
||||
//= require_directory ./lib
|
||||
//= require ./src/Metamaps.GlobalUI
|
||||
//= require ./src/Metamaps.Router
|
||||
//= require ./src/Metamaps.Backbone
|
||||
//= require ./src/Metamaps.Views
|
||||
//= require ./src/JIT
|
||||
//= require ./src/Metamaps
|
||||
//= require ./src/Metamaps.JIT
|
||||
//= require_directory ./shims
|
||||
//= require_directory ./require
|
||||
//= require_directory ./famous
|
|
@ -1,426 +1,426 @@
|
|||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// CloudCarousel V1.0.5
|
||||
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
|
||||
// MIT License
|
||||
//
|
||||
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
|
||||
//
|
||||
// Please retain this copyright header in all versions of the software
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
var matched, browser;
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
|
||||
(function($) {
|
||||
|
||||
// START Reflection object.
|
||||
// Creates a reflection for underneath an image.
|
||||
// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.
|
||||
// The position and size of the reflection gets updated by updateAll() in Controller.
|
||||
function Reflection(img, reflHeight, opacity) {
|
||||
|
||||
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
|
||||
|
||||
parent = $(img.parentNode);
|
||||
this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
|
||||
if ( !reflection.getContext && $.browser.msie) {
|
||||
this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];
|
||||
reflection.src = img.src;
|
||||
reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";
|
||||
|
||||
} else {
|
||||
cntx = reflection.getContext("2d");
|
||||
try {
|
||||
|
||||
|
||||
$(reflection).attr({width: imageWidth, height: reflHeight});
|
||||
cntx.save();
|
||||
cntx.translate(0, imageHeight-1);
|
||||
cntx.scale(1, -1);
|
||||
cntx.drawImage(img, 0, 0, imageWidth, imageHeight);
|
||||
cntx.restore();
|
||||
cntx.globalCompositeOperation = "destination-out";
|
||||
gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
|
||||
gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
|
||||
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
|
||||
cntx.fillStyle = gradient;
|
||||
cntx.fillRect(0, 0, imageWidth, reflHeight);
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Store a copy of the alt and title attrs into the reflection
|
||||
$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );
|
||||
|
||||
} //END Reflection object
|
||||
|
||||
// START Item object.
|
||||
// A wrapper object for items within the carousel.
|
||||
var Item = function(imgIn, options)
|
||||
{
|
||||
this.orgWidth = imgIn.width;
|
||||
this.orgHeight = imgIn.height;
|
||||
this.image = imgIn;
|
||||
this.reflection = null;
|
||||
this.alt = imgIn.alt;
|
||||
this.title = imgIn.title;
|
||||
this.imageOK = false;
|
||||
this.options = options;
|
||||
|
||||
this.imageOK = true;
|
||||
|
||||
if (this.options.reflHeight > 0)
|
||||
{
|
||||
this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);
|
||||
}
|
||||
$(this.image).css('position','absolute'); // Bizarre. This seems to reset image width to 0 on webkit!
|
||||
};// END Item object
|
||||
|
||||
|
||||
// Controller object.
|
||||
// This handles moving all the items, dealing with mouse clicks etc.
|
||||
var Controller = function(container, images, options)
|
||||
{
|
||||
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
|
||||
this.controlTimer = 0;
|
||||
this.stopped = false;
|
||||
//this.imagesLoaded = 0;
|
||||
this.container = container;
|
||||
this.xRadius = options.xRadius;
|
||||
this.yRadius = options.yRadius;
|
||||
this.showFrontTextTimer = 0;
|
||||
this.autoRotateTimer = 0;
|
||||
if (options.xRadius === 0)
|
||||
{
|
||||
this.xRadius = ($(container).width()/2.3);
|
||||
}
|
||||
if (options.yRadius === 0)
|
||||
{
|
||||
this.yRadius = ($(container).height()/6);
|
||||
}
|
||||
|
||||
this.xCentre = options.xPos;
|
||||
this.yCentre = options.yPos;
|
||||
this.frontIndex = 0; // Index of the item at the front
|
||||
|
||||
// Start with the first item at the front.
|
||||
this.rotation = this.destRotation = Math.PI/2;
|
||||
this.timeDelay = 1000/options.FPS;
|
||||
|
||||
// Turn on the infoBox
|
||||
if(options.altBox !== null)
|
||||
{
|
||||
$(options.altBox).css('display','block');
|
||||
$(options.titleBox).css('display','block');
|
||||
}
|
||||
// Turn on relative position for container to allow absolutely positioned elements
|
||||
// within it to work.
|
||||
$(container).css({ position:'relative', overflow:'hidden'} );
|
||||
|
||||
$(options.buttonLeft).css('display','inline');
|
||||
$(options.buttonRight).css('display','inline');
|
||||
|
||||
// Setup the buttons.
|
||||
$(options.buttonLeft).bind('mouseup',this,function(event){
|
||||
event.data.rotate(-1);
|
||||
return false;
|
||||
});
|
||||
$(options.buttonRight).bind('mouseup',this,function(event){
|
||||
event.data.rotate(1);
|
||||
return false;
|
||||
});
|
||||
|
||||
// Add code that makes tab and shift+tab scroll through metacodes
|
||||
$('.new_topic').bind('keydown',this,function(event){
|
||||
if (event.keyCode == 9 && event.shiftKey) {
|
||||
event.data.rotate(-1);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if (event.keyCode == 9) {
|
||||
event.data.rotate(1);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
|
||||
if (options.mouseWheel)
|
||||
{
|
||||
// START METAMAPS CODE
|
||||
$('body').bind('mousewheel',this,function(event, delta) {
|
||||
if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.isSwitchingSet) {
|
||||
event.data.rotate(delta);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// END METAMAPS CODE
|
||||
/* ORIGINAL CODE
|
||||
$(container).bind('mousewheel',this,function(event, delta) {
|
||||
event.data.rotate(delta);
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
}
|
||||
$(container).bind('mouseover click',this,function(event){
|
||||
|
||||
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
|
||||
var text = $(event.target).attr('alt');
|
||||
// If we have moved over a carousel item, then show the alt and title text.
|
||||
|
||||
if ( text !== undefined && text !== null )
|
||||
{
|
||||
|
||||
clearTimeout(event.data.showFrontTextTimer);
|
||||
$(options.altBox).html( ($(event.target).attr('alt') ));
|
||||
//$(options.titleBox).html( ($(event.target).attr('title') ));
|
||||
if ( options.bringToFront && event.type == 'click' )
|
||||
{
|
||||
$(options.titleBox).html( ($(event.target).attr('title') ));
|
||||
// METAMAPS CODE
|
||||
Metamaps.Create.newTopic.metacode = $(event.target).attr('data-id');
|
||||
// NOT METAMAPS CODE
|
||||
var idx = $(event.target).data('itemIndex');
|
||||
var frontIndex = event.data.frontIndex;
|
||||
//var diff = idx - frontIndex;
|
||||
var diff = (idx - frontIndex) % images.length;
|
||||
if (Math.abs(diff) > images.length / 2) {
|
||||
diff += (diff > 0 ? -images.length : images.length);
|
||||
}
|
||||
|
||||
event.data.rotate(-diff);
|
||||
}
|
||||
}
|
||||
});
|
||||
// If we have moved out of a carousel item (or the container itself),
|
||||
// restore the text of the front item in 1 second.
|
||||
$(container).bind('mouseout',this,function(event){
|
||||
var context = event.data;
|
||||
clearTimeout(context.showFrontTextTimer);
|
||||
context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
|
||||
context.autoRotate(); // Start auto rotation.
|
||||
});
|
||||
|
||||
// Prevent items from being selected as mouse is moved and clicked in the container.
|
||||
$(container).bind('mousedown',this,function(event){
|
||||
|
||||
event.data.container.focus();
|
||||
return false;
|
||||
});
|
||||
container.onselectstart = function () { return false; }; // For IE.
|
||||
|
||||
this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
|
||||
|
||||
// Shows the text from the front most item.
|
||||
this.showFrontText = function()
|
||||
{
|
||||
if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet.
|
||||
// METAMAPS CODE
|
||||
Metamaps.Create.newTopic.metacode = $(items[this.frontIndex].image).attr('data-id');
|
||||
//$('img.cloudcarousel').css({"background":"none", "width":"","height":""});
|
||||
//$(items[this.frontIndex].image).css({"width":"45px","height":"45px"});
|
||||
// NOT METAMAPS CODE
|
||||
$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
|
||||
$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));
|
||||
};
|
||||
|
||||
this.go = function()
|
||||
{
|
||||
if(this.controlTimer !== 0) { return; }
|
||||
var context = this;
|
||||
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
|
||||
};
|
||||
|
||||
this.stop = function()
|
||||
{
|
||||
clearTimeout(this.controlTimer);
|
||||
this.controlTimer = 0;
|
||||
};
|
||||
|
||||
|
||||
// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
|
||||
this.rotate = function(direction)
|
||||
{
|
||||
this.frontIndex -= direction;
|
||||
if (this.frontIndex == -1) this.frontIndex = items.length - 1;
|
||||
this.frontIndex %= items.length;
|
||||
this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
|
||||
this.showFrontText();
|
||||
this.go();
|
||||
};
|
||||
|
||||
|
||||
this.autoRotate = function()
|
||||
{
|
||||
if ( options.autoRotate !== 'no' )
|
||||
{
|
||||
var dir = (options.autoRotate === 'right')? 1 : -1;
|
||||
this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
|
||||
}
|
||||
};
|
||||
|
||||
// This is the main loop function that moves everything.
|
||||
this.updateAll = function()
|
||||
{
|
||||
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
|
||||
var smallRange = (1-minScale) * 0.5;
|
||||
var w,h,x,y,scale,item,sinVal;
|
||||
|
||||
var change = (this.destRotation - this.rotation);
|
||||
var absChange = Math.abs(change);
|
||||
|
||||
this.rotation += change * options.speed;
|
||||
if ( absChange < 0.001 ) { this.rotation = this.destRotation; }
|
||||
var itemsLen = items.length;
|
||||
var spacing = (Math.PI / itemsLen) * 2;
|
||||
//var wrapStyle = null;
|
||||
var radians = this.rotation;
|
||||
var isMSIE = $.browser.msie;
|
||||
|
||||
// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
|
||||
// See http://dev.opera.com/articles/view/efficient-javascript/?page=3
|
||||
this.innerWrapper.style.display = 'none';
|
||||
|
||||
var style;
|
||||
var px = 'px', reflHeight;
|
||||
var context = this;
|
||||
for (var i = 0; i<itemsLen ;i++)
|
||||
{
|
||||
item = items[i];
|
||||
|
||||
sinVal = funcSin(radians);
|
||||
|
||||
scale = ((sinVal+1) * smallRange) + minScale;
|
||||
|
||||
x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
|
||||
y = this.yCentre + (( (sinVal * this.yRadius) ) * scale);
|
||||
|
||||
if (item.imageOK)
|
||||
{
|
||||
var img = item.image;
|
||||
|
||||
img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
|
||||
w = img.width = item.orgWidth * scale;
|
||||
h = img.height = item.orgHeight * scale;
|
||||
img.style.left = x + px ;
|
||||
img.style.top = y + px;
|
||||
if (item.reflection !== null)
|
||||
{
|
||||
reflHeight = options.reflHeight * scale;
|
||||
style = item.reflection.element.style;
|
||||
style.left = x + px;
|
||||
style.top = y + h + options.reflGap * scale + px;
|
||||
style.width = w + px;
|
||||
if (isMSIE)
|
||||
{
|
||||
style.filter.finishy = (reflHeight / h * 100);
|
||||
}else
|
||||
{
|
||||
style.height = reflHeight + px;
|
||||
}
|
||||
}
|
||||
}
|
||||
radians += spacing;
|
||||
}
|
||||
// Turn display back on.
|
||||
this.innerWrapper.style.display = 'block';
|
||||
|
||||
// If we have a preceptable change in rotation then loop again next frame.
|
||||
if ( absChange >= 0.001 )
|
||||
{
|
||||
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
|
||||
}else
|
||||
{
|
||||
// Otherwise just stop completely.
|
||||
this.stop();
|
||||
}
|
||||
}; // END updateAll
|
||||
|
||||
// Create an Item object for each image
|
||||
// func = function(){return;ctx.updateAll();} ;
|
||||
|
||||
// Check if images have loaded. We need valid widths and heights for the reflections.
|
||||
this.checkImagesLoaded = function()
|
||||
{
|
||||
var i;
|
||||
for(i=0;i<images.length;i++) {
|
||||
if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete) ))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
for(i=0;i<images.length;i++) {
|
||||
items.push( new Item( images[i], options ) );
|
||||
$(images[i]).data('itemIndex',i);
|
||||
}
|
||||
// If all images have valid widths and heights, we can stop checking.
|
||||
clearInterval(this.tt);
|
||||
this.showFrontText();
|
||||
this.autoRotate();
|
||||
this.updateAll();
|
||||
|
||||
};
|
||||
|
||||
this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);
|
||||
}; // END Controller object
|
||||
|
||||
// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
|
||||
$.fn.CloudCarousel = function(options) {
|
||||
|
||||
this.each( function() {
|
||||
|
||||
options = $.extend({}, {
|
||||
reflHeight:0,
|
||||
reflOpacity:0.5,
|
||||
reflGap:0,
|
||||
minScale:0.5,
|
||||
xPos:0,
|
||||
yPos:0,
|
||||
xRadius:0,
|
||||
yRadius:0,
|
||||
altBox:null,
|
||||
titleBox:null,
|
||||
FPS: 30,
|
||||
autoRotate: 'no',
|
||||
autoRotateDelay: 1500,
|
||||
speed:0.2,
|
||||
mouseWheel: false,
|
||||
bringToFront: false
|
||||
},options );
|
||||
// Create a Controller for each carousel.
|
||||
$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
// CloudCarousel V1.0.5
|
||||
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
|
||||
// MIT License
|
||||
//
|
||||
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
|
||||
//
|
||||
// Please retain this copyright header in all versions of the software
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
var matched, browser;
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
|
||||
(function($) {
|
||||
|
||||
// START Reflection object.
|
||||
// Creates a reflection for underneath an image.
|
||||
// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.
|
||||
// The position and size of the reflection gets updated by updateAll() in Controller.
|
||||
function Reflection(img, reflHeight, opacity) {
|
||||
|
||||
var reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
|
||||
|
||||
parent = $(img.parentNode);
|
||||
this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
|
||||
if ( !reflection.getContext && $.browser.msie) {
|
||||
this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];
|
||||
reflection.src = img.src;
|
||||
reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";
|
||||
|
||||
} else {
|
||||
cntx = reflection.getContext("2d");
|
||||
try {
|
||||
|
||||
|
||||
$(reflection).attr({width: imageWidth, height: reflHeight});
|
||||
cntx.save();
|
||||
cntx.translate(0, imageHeight-1);
|
||||
cntx.scale(1, -1);
|
||||
cntx.drawImage(img, 0, 0, imageWidth, imageHeight);
|
||||
cntx.restore();
|
||||
cntx.globalCompositeOperation = "destination-out";
|
||||
gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
|
||||
gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
|
||||
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
|
||||
cntx.fillStyle = gradient;
|
||||
cntx.fillRect(0, 0, imageWidth, reflHeight);
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Store a copy of the alt and title attrs into the reflection
|
||||
$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );
|
||||
|
||||
} //END Reflection object
|
||||
|
||||
// START Item object.
|
||||
// A wrapper object for items within the carousel.
|
||||
var Item = function(imgIn, options)
|
||||
{
|
||||
this.orgWidth = imgIn.width;
|
||||
this.orgHeight = imgIn.height;
|
||||
this.image = imgIn;
|
||||
this.reflection = null;
|
||||
this.alt = imgIn.alt;
|
||||
this.title = imgIn.title;
|
||||
this.imageOK = false;
|
||||
this.options = options;
|
||||
|
||||
this.imageOK = true;
|
||||
|
||||
if (this.options.reflHeight > 0)
|
||||
{
|
||||
this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);
|
||||
}
|
||||
$(this.image).css('position','absolute'); // Bizarre. This seems to reset image width to 0 on webkit!
|
||||
};// END Item object
|
||||
|
||||
|
||||
// Controller object.
|
||||
// This handles moving all the items, dealing with mouse clicks etc.
|
||||
var Controller = function(container, images, options)
|
||||
{
|
||||
var items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
|
||||
this.controlTimer = 0;
|
||||
this.stopped = false;
|
||||
//this.imagesLoaded = 0;
|
||||
this.container = container;
|
||||
this.xRadius = options.xRadius;
|
||||
this.yRadius = options.yRadius;
|
||||
this.showFrontTextTimer = 0;
|
||||
this.autoRotateTimer = 0;
|
||||
if (options.xRadius === 0)
|
||||
{
|
||||
this.xRadius = ($(container).width()/2.3);
|
||||
}
|
||||
if (options.yRadius === 0)
|
||||
{
|
||||
this.yRadius = ($(container).height()/6);
|
||||
}
|
||||
|
||||
this.xCentre = options.xPos;
|
||||
this.yCentre = options.yPos;
|
||||
this.frontIndex = 0; // Index of the item at the front
|
||||
|
||||
// Start with the first item at the front.
|
||||
this.rotation = this.destRotation = Math.PI/2;
|
||||
this.timeDelay = 1000/options.FPS;
|
||||
|
||||
// Turn on the infoBox
|
||||
if(options.altBox !== null)
|
||||
{
|
||||
$(options.altBox).css('display','block');
|
||||
$(options.titleBox).css('display','block');
|
||||
}
|
||||
// Turn on relative position for container to allow absolutely positioned elements
|
||||
// within it to work.
|
||||
$(container).css({ position:'relative', overflow:'hidden'} );
|
||||
|
||||
$(options.buttonLeft).css('display','inline');
|
||||
$(options.buttonRight).css('display','inline');
|
||||
|
||||
// Setup the buttons.
|
||||
$(options.buttonLeft).bind('mouseup',this,function(event){
|
||||
event.data.rotate(-1);
|
||||
return false;
|
||||
});
|
||||
$(options.buttonRight).bind('mouseup',this,function(event){
|
||||
event.data.rotate(1);
|
||||
return false;
|
||||
});
|
||||
|
||||
// Add code that makes tab and shift+tab scroll through metacodes
|
||||
$('.new_topic').bind('keydown',this,function(event){
|
||||
if (event.keyCode == 9 && event.shiftKey) {
|
||||
event.data.rotate(-1);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else if (event.keyCode == 9) {
|
||||
event.data.rotate(1);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
|
||||
if (options.mouseWheel)
|
||||
{
|
||||
// START METAMAPS CODE
|
||||
$('body').bind('mousewheel',this,function(event, delta) {
|
||||
if (Metamaps.Create.newTopic.beingCreated && !Metamaps.Create.isSwitchingSet) {
|
||||
event.data.rotate(delta);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// END METAMAPS CODE
|
||||
/* ORIGINAL CODE
|
||||
$(container).bind('mousewheel',this,function(event, delta) {
|
||||
event.data.rotate(delta);
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
}
|
||||
$(container).bind('mouseover click',this,function(event){
|
||||
|
||||
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
|
||||
var text = $(event.target).attr('alt');
|
||||
// If we have moved over a carousel item, then show the alt and title text.
|
||||
|
||||
if ( text !== undefined && text !== null )
|
||||
{
|
||||
|
||||
clearTimeout(event.data.showFrontTextTimer);
|
||||
$(options.altBox).html( ($(event.target).attr('alt') ));
|
||||
//$(options.titleBox).html( ($(event.target).attr('title') ));
|
||||
if ( options.bringToFront && event.type == 'click' )
|
||||
{
|
||||
$(options.titleBox).html( ($(event.target).attr('title') ));
|
||||
// METAMAPS CODE
|
||||
Metamaps.Create.newTopic.metacode = $(event.target).attr('data-id');
|
||||
// NOT METAMAPS CODE
|
||||
var idx = $(event.target).data('itemIndex');
|
||||
var frontIndex = event.data.frontIndex;
|
||||
//var diff = idx - frontIndex;
|
||||
var diff = (idx - frontIndex) % images.length;
|
||||
if (Math.abs(diff) > images.length / 2) {
|
||||
diff += (diff > 0 ? -images.length : images.length);
|
||||
}
|
||||
|
||||
event.data.rotate(-diff);
|
||||
}
|
||||
}
|
||||
});
|
||||
// If we have moved out of a carousel item (or the container itself),
|
||||
// restore the text of the front item in 1 second.
|
||||
$(container).bind('mouseout',this,function(event){
|
||||
var context = event.data;
|
||||
clearTimeout(context.showFrontTextTimer);
|
||||
context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
|
||||
context.autoRotate(); // Start auto rotation.
|
||||
});
|
||||
|
||||
// Prevent items from being selected as mouse is moved and clicked in the container.
|
||||
$(container).bind('mousedown',this,function(event){
|
||||
|
||||
event.data.container.focus();
|
||||
return false;
|
||||
});
|
||||
container.onselectstart = function () { return false; }; // For IE.
|
||||
|
||||
this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
|
||||
|
||||
// Shows the text from the front most item.
|
||||
this.showFrontText = function()
|
||||
{
|
||||
if ( items[this.frontIndex] === undefined ) { return; } // Images might not have loaded yet.
|
||||
// METAMAPS CODE
|
||||
Metamaps.Create.newTopic.metacode = $(items[this.frontIndex].image).attr('data-id');
|
||||
//$('img.cloudcarousel').css({"background":"none", "width":"","height":""});
|
||||
//$(items[this.frontIndex].image).css({"width":"45px","height":"45px"});
|
||||
// NOT METAMAPS CODE
|
||||
$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
|
||||
$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));
|
||||
};
|
||||
|
||||
this.go = function()
|
||||
{
|
||||
if(this.controlTimer !== 0) { return; }
|
||||
var context = this;
|
||||
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
|
||||
};
|
||||
|
||||
this.stop = function()
|
||||
{
|
||||
clearTimeout(this.controlTimer);
|
||||
this.controlTimer = 0;
|
||||
};
|
||||
|
||||
|
||||
// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
|
||||
this.rotate = function(direction)
|
||||
{
|
||||
this.frontIndex -= direction;
|
||||
if (this.frontIndex == -1) this.frontIndex = items.length - 1;
|
||||
this.frontIndex %= items.length;
|
||||
this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
|
||||
this.showFrontText();
|
||||
this.go();
|
||||
};
|
||||
|
||||
|
||||
this.autoRotate = function()
|
||||
{
|
||||
if ( options.autoRotate !== 'no' )
|
||||
{
|
||||
var dir = (options.autoRotate === 'right')? 1 : -1;
|
||||
this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
|
||||
}
|
||||
};
|
||||
|
||||
// This is the main loop function that moves everything.
|
||||
this.updateAll = function()
|
||||
{
|
||||
var minScale = options.minScale; // This is the smallest scale applied to the furthest item.
|
||||
var smallRange = (1-minScale) * 0.5;
|
||||
var w,h,x,y,scale,item,sinVal;
|
||||
|
||||
var change = (this.destRotation - this.rotation);
|
||||
var absChange = Math.abs(change);
|
||||
|
||||
this.rotation += change * options.speed;
|
||||
if ( absChange < 0.001 ) { this.rotation = this.destRotation; }
|
||||
var itemsLen = items.length;
|
||||
var spacing = (Math.PI / itemsLen) * 2;
|
||||
//var wrapStyle = null;
|
||||
var radians = this.rotation;
|
||||
var isMSIE = $.browser.msie;
|
||||
|
||||
// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
|
||||
// See http://dev.opera.com/articles/view/efficient-javascript/?page=3
|
||||
this.innerWrapper.style.display = 'none';
|
||||
|
||||
var style;
|
||||
var px = 'px', reflHeight;
|
||||
var context = this;
|
||||
for (var i = 0; i<itemsLen ;i++)
|
||||
{
|
||||
item = items[i];
|
||||
|
||||
sinVal = funcSin(radians);
|
||||
|
||||
scale = ((sinVal+1) * smallRange) + minScale;
|
||||
|
||||
x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
|
||||
y = this.yCentre + (( (sinVal * this.yRadius) ) * scale);
|
||||
|
||||
if (item.imageOK)
|
||||
{
|
||||
var img = item.image;
|
||||
|
||||
img.style.zIndex = "" + (scale * 100)>>0; // >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
|
||||
w = img.width = item.orgWidth * scale;
|
||||
h = img.height = item.orgHeight * scale;
|
||||
img.style.left = x + px ;
|
||||
img.style.top = y + px;
|
||||
if (item.reflection !== null)
|
||||
{
|
||||
reflHeight = options.reflHeight * scale;
|
||||
style = item.reflection.element.style;
|
||||
style.left = x + px;
|
||||
style.top = y + h + options.reflGap * scale + px;
|
||||
style.width = w + px;
|
||||
if (isMSIE)
|
||||
{
|
||||
style.filter.finishy = (reflHeight / h * 100);
|
||||
}else
|
||||
{
|
||||
style.height = reflHeight + px;
|
||||
}
|
||||
}
|
||||
}
|
||||
radians += spacing;
|
||||
}
|
||||
// Turn display back on.
|
||||
this.innerWrapper.style.display = 'block';
|
||||
|
||||
// If we have a preceptable change in rotation then loop again next frame.
|
||||
if ( absChange >= 0.001 )
|
||||
{
|
||||
this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);
|
||||
}else
|
||||
{
|
||||
// Otherwise just stop completely.
|
||||
this.stop();
|
||||
}
|
||||
}; // END updateAll
|
||||
|
||||
// Create an Item object for each image
|
||||
// func = function(){return;ctx.updateAll();} ;
|
||||
|
||||
// Check if images have loaded. We need valid widths and heights for the reflections.
|
||||
this.checkImagesLoaded = function()
|
||||
{
|
||||
var i;
|
||||
for(i=0;i<images.length;i++) {
|
||||
if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete) ))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
for(i=0;i<images.length;i++) {
|
||||
items.push( new Item( images[i], options ) );
|
||||
$(images[i]).data('itemIndex',i);
|
||||
}
|
||||
// If all images have valid widths and heights, we can stop checking.
|
||||
clearInterval(this.tt);
|
||||
this.showFrontText();
|
||||
this.autoRotate();
|
||||
this.updateAll();
|
||||
|
||||
};
|
||||
|
||||
this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);
|
||||
}; // END Controller object
|
||||
|
||||
// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
|
||||
$.fn.CloudCarousel = function(options) {
|
||||
|
||||
this.each( function() {
|
||||
|
||||
options = $.extend({}, {
|
||||
reflHeight:0,
|
||||
reflOpacity:0.5,
|
||||
reflGap:0,
|
||||
minScale:0.5,
|
||||
xPos:0,
|
||||
yPos:0,
|
||||
xRadius:0,
|
||||
yRadius:0,
|
||||
altBox:null,
|
||||
titleBox:null,
|
||||
FPS: 30,
|
||||
autoRotate: 'no',
|
||||
autoRotateDelay: 1500,
|
||||
speed:0.2,
|
||||
mouseWheel: false,
|
||||
bringToFront: false
|
||||
},options );
|
||||
// Create a Controller for each carousel.
|
||||
$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
})(jQuery);
|
|
@ -1,180 +1,180 @@
|
|||
/**
|
||||
* jquery.purr.js
|
||||
* Copyright (c) 2008 Net Perspective (net-perspective.com)
|
||||
* Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*
|
||||
* @author R.A. Ray
|
||||
* @projectDescription jQuery plugin for dynamically displaying unobtrusive messages in the browser. Mimics the behavior of the MacOS program "Growl."
|
||||
* @version 0.1.0
|
||||
*
|
||||
* @requires jquery.js (tested with 1.2.6)
|
||||
*
|
||||
* @param fadeInSpeed int - Duration of fade in animation in miliseconds
|
||||
* default: 500
|
||||
* @param fadeOutSpeed int - Duration of fade out animationin miliseconds
|
||||
default: 500
|
||||
* @param removeTimer int - Timeout, in miliseconds, before notice is removed once it is the top non-sticky notice in the list
|
||||
default: 4000
|
||||
* @param isSticky bool - Whether the notice should fade out on its own or wait to be manually closed
|
||||
default: false
|
||||
* @param usingTransparentPNG bool - Whether or not the notice is using transparent .png images in its styling
|
||||
default: false
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
$.purr = function ( notice, options )
|
||||
{
|
||||
// Convert notice to a jQuery object
|
||||
notice = $( notice );
|
||||
|
||||
// Add a class to denote the notice as not sticky
|
||||
if ( !options.isSticky )
|
||||
{
|
||||
notice.addClass( 'not-sticky' );
|
||||
};
|
||||
|
||||
// Get the container element from the page
|
||||
var cont = document.getElementById( 'purr-container' );
|
||||
|
||||
// If the container doesn't yet exist, we need to create it
|
||||
if ( !cont )
|
||||
{
|
||||
cont = '<div id="purr-container"></div>';
|
||||
}
|
||||
|
||||
// Convert cont to a jQuery object
|
||||
cont = $( cont );
|
||||
|
||||
// Add the container to the page
|
||||
$( 'body' ).append( cont );
|
||||
|
||||
notify();
|
||||
|
||||
function notify ()
|
||||
{
|
||||
// Set up the close button
|
||||
var close = document.createElement( 'a' );
|
||||
$( close ).attr(
|
||||
{
|
||||
className: 'close',
|
||||
href: '#close',
|
||||
innerHTML: 'Close'
|
||||
}
|
||||
)
|
||||
.appendTo( notice )
|
||||
.click( function ()
|
||||
{
|
||||
removeNotice();
|
||||
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
// Add the notice to the page and keep it hidden initially
|
||||
notice.appendTo( cont )
|
||||
.hide();
|
||||
|
||||
if ( jQuery.browser.msie && options.usingTransparentPNG )
|
||||
{
|
||||
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
|
||||
// notice style, we'll just skip the fading in.
|
||||
notice.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Fade in the notice we just added
|
||||
notice.fadeIn( options.fadeInSpeed );
|
||||
}
|
||||
|
||||
// Set up the removal interval for the added notice if that notice is not a sticky
|
||||
if ( !options.isSticky )
|
||||
{
|
||||
var topSpotInt = setInterval( function ()
|
||||
{
|
||||
// Check to see if our notice is the first non-sticky notice in the list
|
||||
if ( notice.prevAll( '.not-sticky' ).length == 0 )
|
||||
{
|
||||
// Stop checking once the condition is met
|
||||
clearInterval( topSpotInt );
|
||||
|
||||
// Call the close action after the timeout set in options
|
||||
setTimeout( function ()
|
||||
{
|
||||
removeNotice();
|
||||
}, options.removeTimer
|
||||
);
|
||||
}
|
||||
}, 200 );
|
||||
}
|
||||
}
|
||||
|
||||
function removeNotice ()
|
||||
{
|
||||
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
|
||||
// notice style, we'll just skip the fading out.
|
||||
if ( jQuery.browser.msie && options.usingTransparentPNG )
|
||||
{
|
||||
notice.css( { opacity: 0 } )
|
||||
.animate(
|
||||
{
|
||||
height: '0px'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fade the object out before reducing its height to produce the sliding effect
|
||||
notice.animate(
|
||||
{
|
||||
opacity: '0'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.animate(
|
||||
{
|
||||
height: '0px'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.purr = function ( options )
|
||||
{
|
||||
options = options || {};
|
||||
options.fadeInSpeed = options.fadeInSpeed || 500;
|
||||
options.fadeOutSpeed = options.fadeOutSpeed || 500;
|
||||
options.removeTimer = options.removeTimer || 4000;
|
||||
options.isSticky = options.isSticky || false;
|
||||
options.usingTransparentPNG = options.usingTransparentPNG || false;
|
||||
|
||||
this.each( function()
|
||||
{
|
||||
new $.purr( this, options );
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
})( jQuery );
|
||||
|
||||
/**
|
||||
* jquery.purr.js
|
||||
* Copyright (c) 2008 Net Perspective (net-perspective.com)
|
||||
* Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*
|
||||
* @author R.A. Ray
|
||||
* @projectDescription jQuery plugin for dynamically displaying unobtrusive messages in the browser. Mimics the behavior of the MacOS program "Growl."
|
||||
* @version 0.1.0
|
||||
*
|
||||
* @requires jquery.js (tested with 1.2.6)
|
||||
*
|
||||
* @param fadeInSpeed int - Duration of fade in animation in miliseconds
|
||||
* default: 500
|
||||
* @param fadeOutSpeed int - Duration of fade out animationin miliseconds
|
||||
default: 500
|
||||
* @param removeTimer int - Timeout, in miliseconds, before notice is removed once it is the top non-sticky notice in the list
|
||||
default: 4000
|
||||
* @param isSticky bool - Whether the notice should fade out on its own or wait to be manually closed
|
||||
default: false
|
||||
* @param usingTransparentPNG bool - Whether or not the notice is using transparent .png images in its styling
|
||||
default: false
|
||||
*/
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
$.purr = function ( notice, options )
|
||||
{
|
||||
// Convert notice to a jQuery object
|
||||
notice = $( notice );
|
||||
|
||||
// Add a class to denote the notice as not sticky
|
||||
if ( !options.isSticky )
|
||||
{
|
||||
notice.addClass( 'not-sticky' );
|
||||
};
|
||||
|
||||
// Get the container element from the page
|
||||
var cont = document.getElementById( 'purr-container' );
|
||||
|
||||
// If the container doesn't yet exist, we need to create it
|
||||
if ( !cont )
|
||||
{
|
||||
cont = '<div id="purr-container"></div>';
|
||||
}
|
||||
|
||||
// Convert cont to a jQuery object
|
||||
cont = $( cont );
|
||||
|
||||
// Add the container to the page
|
||||
$( 'body' ).append( cont );
|
||||
|
||||
notify();
|
||||
|
||||
function notify ()
|
||||
{
|
||||
// Set up the close button
|
||||
var close = document.createElement( 'a' );
|
||||
$( close ).attr(
|
||||
{
|
||||
className: 'close',
|
||||
href: '#close',
|
||||
innerHTML: 'Close'
|
||||
}
|
||||
)
|
||||
.appendTo( notice )
|
||||
.click( function ()
|
||||
{
|
||||
removeNotice();
|
||||
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
// Add the notice to the page and keep it hidden initially
|
||||
notice.appendTo( cont )
|
||||
.hide();
|
||||
|
||||
if ( jQuery.browser.msie && options.usingTransparentPNG )
|
||||
{
|
||||
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
|
||||
// notice style, we'll just skip the fading in.
|
||||
notice.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Fade in the notice we just added
|
||||
notice.fadeIn( options.fadeInSpeed );
|
||||
}
|
||||
|
||||
// Set up the removal interval for the added notice if that notice is not a sticky
|
||||
if ( !options.isSticky )
|
||||
{
|
||||
var topSpotInt = setInterval( function ()
|
||||
{
|
||||
// Check to see if our notice is the first non-sticky notice in the list
|
||||
if ( notice.prevAll( '.not-sticky' ).length == 0 )
|
||||
{
|
||||
// Stop checking once the condition is met
|
||||
clearInterval( topSpotInt );
|
||||
|
||||
// Call the close action after the timeout set in options
|
||||
setTimeout( function ()
|
||||
{
|
||||
removeNotice();
|
||||
}, options.removeTimer
|
||||
);
|
||||
}
|
||||
}, 200 );
|
||||
}
|
||||
}
|
||||
|
||||
function removeNotice ()
|
||||
{
|
||||
// IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
|
||||
// notice style, we'll just skip the fading out.
|
||||
if ( jQuery.browser.msie && options.usingTransparentPNG )
|
||||
{
|
||||
notice.css( { opacity: 0 } )
|
||||
.animate(
|
||||
{
|
||||
height: '0px'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fade the object out before reducing its height to produce the sliding effect
|
||||
notice.animate(
|
||||
{
|
||||
opacity: '0'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.animate(
|
||||
{
|
||||
height: '0px'
|
||||
},
|
||||
{
|
||||
duration: options.fadeOutSpeed,
|
||||
complete: function ()
|
||||
{
|
||||
notice.remove();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.purr = function ( options )
|
||||
{
|
||||
options = options || {};
|
||||
options.fadeInSpeed = options.fadeInSpeed || 500;
|
||||
options.fadeOutSpeed = options.fadeOutSpeed || 500;
|
||||
options.removeTimer = options.removeTimer || 4000;
|
||||
options.isSticky = options.isSticky || false;
|
||||
options.usingTransparentPNG = options.usingTransparentPNG || false;
|
||||
|
||||
this.each( function()
|
||||
{
|
||||
new $.purr( this, options );
|
||||
}
|
||||
);
|
||||
|
||||
return this;
|
||||
};
|
||||
})( jQuery );
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,227 +1,227 @@
|
|||
Metamaps.Backbone = {};
|
||||
Metamaps.Backbone.Map = Backbone.Model.extend({
|
||||
urlRoot: '/maps',
|
||||
blacklist: ['created_at', 'updated_at', 'created_at_clean', 'updated_at_clean', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'],
|
||||
toJSON: function (options) {
|
||||
return _.omit(this.attributes, this.blacklist);
|
||||
},
|
||||
save: function (key, val, options) {
|
||||
|
||||
var attrs;
|
||||
|
||||
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||
if (key == null || typeof key === 'object') {
|
||||
attrs = key;
|
||||
options = val;
|
||||
} else {
|
||||
(attrs = {})[key] = val;
|
||||
}
|
||||
|
||||
var newOptions = options || {};
|
||||
var s = newOptions.success;
|
||||
|
||||
newOptions.success = function (model, response, opt) {
|
||||
if (s) s(model, response, opt);
|
||||
model.trigger('saved');
|
||||
};
|
||||
return Backbone.Model.prototype.save.call(this, attrs, newOptions);
|
||||
},
|
||||
initialize: function () {
|
||||
this.on('changeByOther', this.updateView);
|
||||
this.on('saved', this.savedEvent);
|
||||
},
|
||||
savedEvent: function() {
|
||||
Metamaps.Realtime.sendMapChange(this);
|
||||
},
|
||||
authorizeToEdit: function (mapper) {
|
||||
if (mapper && (this.get('permission') === "commons" || this.get('user_id') === mapper.get('id'))) return true;
|
||||
else return false;
|
||||
},
|
||||
authorizePermissionChange: function (mapper) {
|
||||
if (mapper && this.get('user_id') === mapper.get('id')) return true;
|
||||
else return false;
|
||||
},
|
||||
getUser: function () {
|
||||
return Metamaps.Mapper.get(this.get('user_id'));
|
||||
},
|
||||
fetchContained: function () {
|
||||
var bb = Metamaps.Backbone;
|
||||
var that = this;
|
||||
var start = function (data) {
|
||||
that.set('mappers', new bb.MapperCollection(data.mappers));
|
||||
that.set('topics', new bb.TopicCollection(data.topics));
|
||||
that.set('synapses', new bb.SynapseCollection(data.synapses));
|
||||
that.set('mappings', new bb.MappingCollection(data.mappings));
|
||||
};
|
||||
|
||||
var e = $.ajax({
|
||||
url: "/maps/" + this.id + "/contains.json",
|
||||
success: start,
|
||||
error: errorFunc,
|
||||
async: false
|
||||
});
|
||||
},
|
||||
getTopics: function () {
|
||||
if (!this.get('topics')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('topics');
|
||||
},
|
||||
getSynapses: function () {
|
||||
if (!this.get('synapses')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('synapses');
|
||||
},
|
||||
getMappings: function () {
|
||||
if (!this.get('mappings')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('mappings');
|
||||
},
|
||||
getMappers: function () {
|
||||
if (!this.get('mappers')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('mappers');
|
||||
},
|
||||
attrForCards: function () {
|
||||
function capitalize(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
var n = this.get('name');
|
||||
var d = this.get('desc');
|
||||
|
||||
var maxNameLength = 32;
|
||||
var maxDescLength = 118;
|
||||
var truncatedName = n ? (n.length > maxNameLength ? n.substring(0, maxNameLength) + "..." : n) : "";
|
||||
var truncatedDesc = d ? (d.length > maxDescLength ? d.substring(0, maxDescLength) + "..." : d) : "";
|
||||
|
||||
var obj = {
|
||||
id: this.id,
|
||||
name: truncatedName,
|
||||
fullName: n,
|
||||
desc: truncatedDesc,
|
||||
permission: this.get("permission") ? capitalize(this.get("permission")) : "Commons",
|
||||
editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit',
|
||||
contributor_count_number: '<span class="cCountColor">' + this.get('contributor_count') + '</span>',
|
||||
contributor_count_string: this.get('contributor_count') == 1 ? ' contributor' : ' contributors',
|
||||
topic_count_number: '<span class="tCountColor">' + this.get('topic_count') + '</span>',
|
||||
topic_count_string: this.get('topic_count') == 1 ? ' topic' : ' topics',
|
||||
synapse_count_number: '<span class="sCountColor">' + this.get('synapse_count') + '</span>',
|
||||
synapse_count_string: this.get('synapse_count') == 1 ? ' synapse' : ' synapses',
|
||||
screenshot: '<img src="' + this.get('screenshot_url') + '" />'
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
updateView: function() {
|
||||
var map = Metamaps.Active.Map;
|
||||
var isActiveMap = this.id === map.id;
|
||||
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
|
||||
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
|
||||
if (isActiveMap) {
|
||||
Metamaps.Map.InfoBox.updateNameDescPerm(this.get('name'), this.get('desc'), this.get('permission'));
|
||||
this.updateMapWrapper();
|
||||
}
|
||||
},
|
||||
updateMapWrapper: function() {
|
||||
var map = Metamaps.Active.Map;
|
||||
var isActiveMap = this.id === map.id;
|
||||
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
|
||||
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
|
||||
if (isActiveMap) {
|
||||
$('.wrapper').removeClass('canEditMap commonsMap').addClass(authorized + ' ' + commonsMap);
|
||||
}
|
||||
}
|
||||
});
|
||||
Metamaps.Backbone.MapsCollection = Backbone.Collection.extend({
|
||||
model: Metamaps.Backbone.Map,
|
||||
initialize: function(models, options) {
|
||||
this.id = options.id;
|
||||
this.sortBy = options.sortBy;
|
||||
|
||||
if (options.mapperId) {
|
||||
this.mapperId = options.mapperId;
|
||||
}
|
||||
|
||||
// this.page represents the NEXT page to fetch
|
||||
this.page = models.length > 0 ? (models.length < 20 ? "loadedAll" : 2) : 1;
|
||||
},
|
||||
url: function() {
|
||||
if (!this.mapperId) {
|
||||
return '/explore/' + this.id + '.json';
|
||||
}
|
||||
else {
|
||||
return '/explore/mapper/' + this.mapperId + '.json';
|
||||
}
|
||||
},
|
||||
comparator: function (a, b) {
|
||||
a = a.get(this.sortBy);
|
||||
b = b.get(this.sortBy);
|
||||
var temp;
|
||||
if (this.sortBy === 'name') {
|
||||
a = a ? a.toLowerCase() : "";
|
||||
b = b ? b.toLowerCase() : "";
|
||||
}
|
||||
else {
|
||||
// this is for updated_at and created_at
|
||||
temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
a = (new Date(a)).getTime();
|
||||
b = (new Date(b)).getTime();
|
||||
}
|
||||
return a > b ? 1 : a < b ? -1 : 0;
|
||||
},
|
||||
getMaps: function (cb) {
|
||||
|
||||
var self = this;
|
||||
|
||||
Metamaps.Loading.show();
|
||||
|
||||
if (this.page != "loadedAll") {
|
||||
var numBefore = this.length;
|
||||
this.fetch({
|
||||
remove: false,
|
||||
silent: true,
|
||||
data: { page: this.page },
|
||||
success: function (collection, response, options) {
|
||||
// you can pass additional options to the event you trigger here as well
|
||||
if (collection.length - numBefore < 20) {
|
||||
self.page = "loadedAll";
|
||||
}
|
||||
else self.page += 1;
|
||||
self.trigger('successOnFetch', cb);
|
||||
},
|
||||
error: function (collection, response, options) {
|
||||
// you can pass additional options to the event you trigger here as well
|
||||
self.trigger('errorOnFetch');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
self.trigger('successOnFetch', cb);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Backbone.Mapper = Backbone.Model.extend({
|
||||
urlRoot: '/users',
|
||||
blacklist: ['created_at', 'updated_at'],
|
||||
toJSON: function (options) {
|
||||
return _.omit(this.attributes, this.blacklist);
|
||||
},
|
||||
prepareLiForFilter: function () {
|
||||
var li = '';
|
||||
li += '<li data-id="' + this.id.toString() + '">';
|
||||
li += '<img src="' + this.get("image") + '" data-id="' + this.id.toString() + '"';
|
||||
li += ' alt="' + this.get('name') + '" />';
|
||||
li += '<p>' + this.get('name') + '</p></li>';
|
||||
return li;
|
||||
}
|
||||
});
|
||||
Metamaps.Backbone.MapperCollection = Backbone.Collection.extend({
|
||||
model: Metamaps.Backbone.Mapper,
|
||||
url: '/users'
|
||||
Metamaps.Backbone = {};
|
||||
Metamaps.Backbone.Map = Backbone.Model.extend({
|
||||
urlRoot: '/maps',
|
||||
blacklist: ['created_at', 'updated_at', 'created_at_clean', 'updated_at_clean', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'],
|
||||
toJSON: function (options) {
|
||||
return _.omit(this.attributes, this.blacklist);
|
||||
},
|
||||
save: function (key, val, options) {
|
||||
|
||||
var attrs;
|
||||
|
||||
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||
if (key == null || typeof key === 'object') {
|
||||
attrs = key;
|
||||
options = val;
|
||||
} else {
|
||||
(attrs = {})[key] = val;
|
||||
}
|
||||
|
||||
var newOptions = options || {};
|
||||
var s = newOptions.success;
|
||||
|
||||
newOptions.success = function (model, response, opt) {
|
||||
if (s) s(model, response, opt);
|
||||
model.trigger('saved');
|
||||
};
|
||||
return Backbone.Model.prototype.save.call(this, attrs, newOptions);
|
||||
},
|
||||
initialize: function () {
|
||||
this.on('changeByOther', this.updateView);
|
||||
this.on('saved', this.savedEvent);
|
||||
},
|
||||
savedEvent: function() {
|
||||
Metamaps.Realtime.sendMapChange(this);
|
||||
},
|
||||
authorizeToEdit: function (mapper) {
|
||||
if (mapper && (this.get('permission') === "commons" || this.get('user_id') === mapper.get('id'))) return true;
|
||||
else return false;
|
||||
},
|
||||
authorizePermissionChange: function (mapper) {
|
||||
if (mapper && this.get('user_id') === mapper.get('id')) return true;
|
||||
else return false;
|
||||
},
|
||||
getUser: function () {
|
||||
return Metamaps.Mapper.get(this.get('user_id'));
|
||||
},
|
||||
fetchContained: function () {
|
||||
var bb = Metamaps.Backbone;
|
||||
var that = this;
|
||||
var start = function (data) {
|
||||
that.set('mappers', new bb.MapperCollection(data.mappers));
|
||||
that.set('topics', new bb.TopicCollection(data.topics));
|
||||
that.set('synapses', new bb.SynapseCollection(data.synapses));
|
||||
that.set('mappings', new bb.MappingCollection(data.mappings));
|
||||
};
|
||||
|
||||
var e = $.ajax({
|
||||
url: "/maps/" + this.id + "/contains.json",
|
||||
success: start,
|
||||
error: errorFunc,
|
||||
async: false
|
||||
});
|
||||
},
|
||||
getTopics: function () {
|
||||
if (!this.get('topics')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('topics');
|
||||
},
|
||||
getSynapses: function () {
|
||||
if (!this.get('synapses')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('synapses');
|
||||
},
|
||||
getMappings: function () {
|
||||
if (!this.get('mappings')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('mappings');
|
||||
},
|
||||
getMappers: function () {
|
||||
if (!this.get('mappers')) {
|
||||
this.fetchContained();
|
||||
}
|
||||
return this.get('mappers');
|
||||
},
|
||||
attrForCards: function () {
|
||||
function capitalize(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
var n = this.get('name');
|
||||
var d = this.get('desc');
|
||||
|
||||
var maxNameLength = 32;
|
||||
var maxDescLength = 118;
|
||||
var truncatedName = n ? (n.length > maxNameLength ? n.substring(0, maxNameLength) + "..." : n) : "";
|
||||
var truncatedDesc = d ? (d.length > maxDescLength ? d.substring(0, maxDescLength) + "..." : d) : "";
|
||||
|
||||
var obj = {
|
||||
id: this.id,
|
||||
name: truncatedName,
|
||||
fullName: n,
|
||||
desc: truncatedDesc,
|
||||
permission: this.get("permission") ? capitalize(this.get("permission")) : "Commons",
|
||||
editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit',
|
||||
contributor_count_number: '<span class="cCountColor">' + this.get('contributor_count') + '</span>',
|
||||
contributor_count_string: this.get('contributor_count') == 1 ? ' contributor' : ' contributors',
|
||||
topic_count_number: '<span class="tCountColor">' + this.get('topic_count') + '</span>',
|
||||
topic_count_string: this.get('topic_count') == 1 ? ' topic' : ' topics',
|
||||
synapse_count_number: '<span class="sCountColor">' + this.get('synapse_count') + '</span>',
|
||||
synapse_count_string: this.get('synapse_count') == 1 ? ' synapse' : ' synapses',
|
||||
screenshot: '<img src="' + this.get('screenshot_url') + '" />'
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
updateView: function() {
|
||||
var map = Metamaps.Active.Map;
|
||||
var isActiveMap = this.id === map.id;
|
||||
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
|
||||
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
|
||||
if (isActiveMap) {
|
||||
Metamaps.Map.InfoBox.updateNameDescPerm(this.get('name'), this.get('desc'), this.get('permission'));
|
||||
this.updateMapWrapper();
|
||||
}
|
||||
},
|
||||
updateMapWrapper: function() {
|
||||
var map = Metamaps.Active.Map;
|
||||
var isActiveMap = this.id === map.id;
|
||||
var authorized = map && map.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEditMap' : '';
|
||||
var commonsMap = map && map.get('permission') === 'commons' ? 'commonsMap' : '';
|
||||
if (isActiveMap) {
|
||||
$('.wrapper').removeClass('canEditMap commonsMap').addClass(authorized + ' ' + commonsMap);
|
||||
}
|
||||
}
|
||||
});
|
||||
Metamaps.Backbone.MapsCollection = Backbone.Collection.extend({
|
||||
model: Metamaps.Backbone.Map,
|
||||
initialize: function(models, options) {
|
||||
this.id = options.id;
|
||||
this.sortBy = options.sortBy;
|
||||
|
||||
if (options.mapperId) {
|
||||
this.mapperId = options.mapperId;
|
||||
}
|
||||
|
||||
// this.page represents the NEXT page to fetch
|
||||
this.page = models.length > 0 ? (models.length < 20 ? "loadedAll" : 2) : 1;
|
||||
},
|
||||
url: function() {
|
||||
if (!this.mapperId) {
|
||||
return '/explore/' + this.id + '.json';
|
||||
}
|
||||
else {
|
||||
return '/explore/mapper/' + this.mapperId + '.json';
|
||||
}
|
||||
},
|
||||
comparator: function (a, b) {
|
||||
a = a.get(this.sortBy);
|
||||
b = b.get(this.sortBy);
|
||||
var temp;
|
||||
if (this.sortBy === 'name') {
|
||||
a = a ? a.toLowerCase() : "";
|
||||
b = b ? b.toLowerCase() : "";
|
||||
}
|
||||
else {
|
||||
// this is for updated_at and created_at
|
||||
temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
a = (new Date(a)).getTime();
|
||||
b = (new Date(b)).getTime();
|
||||
}
|
||||
return a > b ? 1 : a < b ? -1 : 0;
|
||||
},
|
||||
getMaps: function (cb) {
|
||||
|
||||
var self = this;
|
||||
|
||||
Metamaps.Loading.show();
|
||||
|
||||
if (this.page != "loadedAll") {
|
||||
var numBefore = this.length;
|
||||
this.fetch({
|
||||
remove: false,
|
||||
silent: true,
|
||||
data: { page: this.page },
|
||||
success: function (collection, response, options) {
|
||||
// you can pass additional options to the event you trigger here as well
|
||||
if (collection.length - numBefore < 20) {
|
||||
self.page = "loadedAll";
|
||||
}
|
||||
else self.page += 1;
|
||||
self.trigger('successOnFetch', cb);
|
||||
},
|
||||
error: function (collection, response, options) {
|
||||
// you can pass additional options to the event you trigger here as well
|
||||
self.trigger('errorOnFetch');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
self.trigger('successOnFetch', cb);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Backbone.Mapper = Backbone.Model.extend({
|
||||
urlRoot: '/users',
|
||||
blacklist: ['created_at', 'updated_at'],
|
||||
toJSON: function (options) {
|
||||
return _.omit(this.attributes, this.blacklist);
|
||||
},
|
||||
prepareLiForFilter: function () {
|
||||
var li = '';
|
||||
li += '<li data-id="' + this.id.toString() + '">';
|
||||
li += '<img src="' + this.get("image") + '" data-id="' + this.id.toString() + '"';
|
||||
li += ' alt="' + this.get('name') + '" />';
|
||||
li += '<p>' + this.get('name') + '</p></li>';
|
||||
return li;
|
||||
}
|
||||
});
|
||||
Metamaps.Backbone.MapperCollection = Backbone.Collection.extend({
|
||||
model: Metamaps.Backbone.Mapper,
|
||||
url: '/users'
|
||||
});
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,262 +1,262 @@
|
|||
(function () {
|
||||
|
||||
Metamaps.currentPage = "";
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
"": "home", // #home
|
||||
"explore/:section": "explore", // #explore/active
|
||||
"explore/:section/:id": "explore", // #explore/mapper/1234
|
||||
"maps/:id": "maps" // #maps/7
|
||||
},
|
||||
home: function () {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
if (Metamaps.Active.Mapper) document.title = 'Explore Active Maps | Metamaps';
|
||||
else document.title = 'Home | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "";
|
||||
Metamaps.currentPage = "";
|
||||
$('.wrapper').removeClass('mapPage topicPage');
|
||||
|
||||
var classes = Metamaps.Active.Mapper ? "homePage explorePage" : "homePage";
|
||||
$('.wrapper').addClass(classes);
|
||||
|
||||
var navigate = function() {
|
||||
Metamaps.routerTimeoutId = setTimeout(function() {
|
||||
Metamaps.Router.navigate("");
|
||||
}, 300);
|
||||
};
|
||||
// all this only for the logged in home page
|
||||
if (Metamaps.Active.Mapper) {
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
|
||||
Metamaps.Famous.explore.set('active');
|
||||
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
|
||||
Metamaps.Famous.explore.show();
|
||||
|
||||
Metamaps.Famous.maps.show();
|
||||
|
||||
Metamaps.GlobalUI.Search.open();
|
||||
Metamaps.GlobalUI.Search.lock();
|
||||
|
||||
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps.Active );
|
||||
if (Metamaps.Maps.Active.length === 0) {
|
||||
Metamaps.Maps.Active.getMaps(navigate); // this will trigger an explore maps render
|
||||
}
|
||||
else {
|
||||
Metamaps.Views.exploreMaps.render(navigate);
|
||||
}
|
||||
}
|
||||
// logged out home page
|
||||
else {
|
||||
|
||||
Metamaps.Famous.yield.show();
|
||||
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.routerTimeoutId = setTimeout(navigate, 500);
|
||||
}
|
||||
|
||||
Metamaps.Famous.viz.hide();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Map = null;
|
||||
Metamaps.Active.Topic = null;
|
||||
},
|
||||
explore: function (section, id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
// just capitalize the variable section
|
||||
// either 'featured', 'mapper', or 'active'
|
||||
var capitalize = section.charAt(0).toUpperCase() + section.slice(1);
|
||||
|
||||
if (section === "featured" || section === "active") {
|
||||
document.title = 'Explore ' + capitalize + ' Maps | Metamaps';
|
||||
}
|
||||
else if (section === "mapper") {
|
||||
$.ajax({
|
||||
url: "/users/" + id + ".json",
|
||||
success: function (response) {
|
||||
document.title = response.name + ' | Metamaps';
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (section === "mine") {
|
||||
document.title = 'Explore My Maps | Metamaps';
|
||||
}
|
||||
|
||||
$('.wrapper').removeClass('homePage mapPage topicPage');
|
||||
$('.wrapper').addClass('explorePage');
|
||||
|
||||
Metamaps.currentSection = "explore";
|
||||
Metamaps.currentPage = section;
|
||||
|
||||
// this will mean it's a mapper page being loaded
|
||||
if (id) {
|
||||
if (Metamaps.Maps.Mapper.mapperId !== id) {
|
||||
// empty the collection if we are trying to load the maps
|
||||
// collection of a different mapper than we had previously
|
||||
Metamaps.Maps.Mapper.reset();
|
||||
Metamaps.Maps.Mapper.page = 1;
|
||||
}
|
||||
Metamaps.Maps.Mapper.mapperId = id;
|
||||
}
|
||||
|
||||
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps[capitalize] );
|
||||
|
||||
var navigate = function(){
|
||||
var path = "/explore/" + Metamaps.currentPage;
|
||||
|
||||
// alter url if for mapper profile page
|
||||
if (Metamaps.currentPage == "mapper") {
|
||||
path += "/" + Metamaps.Maps.Mapper.mapperId;
|
||||
}
|
||||
|
||||
Metamaps.Router.navigate(path);
|
||||
};
|
||||
var navigateTimeout = function() {
|
||||
Metamaps.routerTimeoutId = setTimeout(navigate, 300);
|
||||
};
|
||||
if (Metamaps.Maps[capitalize].length === 0) {
|
||||
Metamaps.Loading.show();
|
||||
setTimeout(function(){
|
||||
Metamaps.Maps[capitalize].getMaps(navigate); // this will trigger an explore maps render
|
||||
}, 300); // wait 300 milliseconds till the other animations are done to do the fetch
|
||||
}
|
||||
else {
|
||||
if (id) {
|
||||
Metamaps.Views.exploreMaps.fetchUserThenRender(navigateTimeout);
|
||||
}
|
||||
else {
|
||||
Metamaps.Views.exploreMaps.render(navigateTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
Metamaps.GlobalUI.Search.open();
|
||||
Metamaps.GlobalUI.Search.lock();
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
|
||||
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
|
||||
Metamaps.Famous.maps.show();
|
||||
Metamaps.Famous.explore.set(section, id);
|
||||
Metamaps.Famous.explore.show();
|
||||
|
||||
Metamaps.Famous.viz.hide();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Map = null;
|
||||
Metamaps.Active.Topic = null;
|
||||
},
|
||||
maps: function (id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
document.title = 'Map ' + id + ' | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "map";
|
||||
Metamaps.currentPage = id;
|
||||
|
||||
$('.wrapper').removeClass('homePage explorePage topicPage');
|
||||
$('.wrapper').addClass('mapPage');
|
||||
// another class will be added to wrapper if you
|
||||
// can edit this map '.canEditMap'
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
// clear the visualization, if there was one, before showing its div again
|
||||
if (Metamaps.Visualize.mGraph) {
|
||||
Metamaps.Visualize.mGraph.graph.empty();
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
|
||||
}
|
||||
Metamaps.Famous.viz.show();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Topic = null;
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Loading.show();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Map.launch(id);
|
||||
},
|
||||
topics: function (id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
document.title = 'Topic ' + id + ' | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "topic";
|
||||
Metamaps.currentPage = id;
|
||||
|
||||
$('.wrapper').removeClass('homePage explorePage mapPage');
|
||||
$('.wrapper').addClass('topicPage');
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
// clear the visualization, if there was one, before showing its div again
|
||||
if (Metamaps.Visualize.mGraph) {
|
||||
Metamaps.Visualize.mGraph.graph.empty();
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
|
||||
}
|
||||
Metamaps.Famous.viz.show();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Active.Map = null;
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Topic.launch(id);
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Router = new Router();
|
||||
|
||||
|
||||
Metamaps.Router.intercept = function (evt) {
|
||||
var segments;
|
||||
|
||||
var href = {
|
||||
prop: $(this).prop("href"),
|
||||
attr: $(this).attr("href")
|
||||
};
|
||||
var root = location.protocol + "//" + location.host + Backbone.history.options.root;
|
||||
|
||||
if (href.prop && href.prop === root) href.attr = "";
|
||||
|
||||
if (href.prop && href.prop.slice(0, root.length) === root) {
|
||||
evt.preventDefault();
|
||||
|
||||
segments = href.attr.split('/');
|
||||
segments.splice(0,1); // pop off the element created by the first /
|
||||
|
||||
if (href.attr === "") Metamaps.Router.home();
|
||||
else {
|
||||
Metamaps.Router[segments[0]](segments[1], segments[2]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
silent: true,
|
||||
pushState: true,
|
||||
root: '/'
|
||||
});
|
||||
$(document).on("click", "a:not([data-bypass])", Metamaps.Router.intercept);
|
||||
};
|
||||
})();
|
||||
(function () {
|
||||
|
||||
Metamaps.currentPage = "";
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
"": "home", // #home
|
||||
"explore/:section": "explore", // #explore/active
|
||||
"explore/:section/:id": "explore", // #explore/mapper/1234
|
||||
"maps/:id": "maps" // #maps/7
|
||||
},
|
||||
home: function () {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
if (Metamaps.Active.Mapper) document.title = 'Explore Active Maps | Metamaps';
|
||||
else document.title = 'Home | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "";
|
||||
Metamaps.currentPage = "";
|
||||
$('.wrapper').removeClass('mapPage topicPage');
|
||||
|
||||
var classes = Metamaps.Active.Mapper ? "homePage explorePage" : "homePage";
|
||||
$('.wrapper').addClass(classes);
|
||||
|
||||
var navigate = function() {
|
||||
Metamaps.routerTimeoutId = setTimeout(function() {
|
||||
Metamaps.Router.navigate("");
|
||||
}, 300);
|
||||
};
|
||||
// all this only for the logged in home page
|
||||
if (Metamaps.Active.Mapper) {
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
|
||||
Metamaps.Famous.explore.set('active');
|
||||
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
|
||||
Metamaps.Famous.explore.show();
|
||||
|
||||
Metamaps.Famous.maps.show();
|
||||
|
||||
Metamaps.GlobalUI.Search.open();
|
||||
Metamaps.GlobalUI.Search.lock();
|
||||
|
||||
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps.Active );
|
||||
if (Metamaps.Maps.Active.length === 0) {
|
||||
Metamaps.Maps.Active.getMaps(navigate); // this will trigger an explore maps render
|
||||
}
|
||||
else {
|
||||
Metamaps.Views.exploreMaps.render(navigate);
|
||||
}
|
||||
}
|
||||
// logged out home page
|
||||
else {
|
||||
|
||||
Metamaps.Famous.yield.show();
|
||||
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.routerTimeoutId = setTimeout(navigate, 500);
|
||||
}
|
||||
|
||||
Metamaps.Famous.viz.hide();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Map = null;
|
||||
Metamaps.Active.Topic = null;
|
||||
},
|
||||
explore: function (section, id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
// just capitalize the variable section
|
||||
// either 'featured', 'mapper', or 'active'
|
||||
var capitalize = section.charAt(0).toUpperCase() + section.slice(1);
|
||||
|
||||
if (section === "featured" || section === "active") {
|
||||
document.title = 'Explore ' + capitalize + ' Maps | Metamaps';
|
||||
}
|
||||
else if (section === "mapper") {
|
||||
$.ajax({
|
||||
url: "/users/" + id + ".json",
|
||||
success: function (response) {
|
||||
document.title = response.name + ' | Metamaps';
|
||||
},
|
||||
error: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (section === "mine") {
|
||||
document.title = 'Explore My Maps | Metamaps';
|
||||
}
|
||||
|
||||
$('.wrapper').removeClass('homePage mapPage topicPage');
|
||||
$('.wrapper').addClass('explorePage');
|
||||
|
||||
Metamaps.currentSection = "explore";
|
||||
Metamaps.currentPage = section;
|
||||
|
||||
// this will mean it's a mapper page being loaded
|
||||
if (id) {
|
||||
if (Metamaps.Maps.Mapper.mapperId !== id) {
|
||||
// empty the collection if we are trying to load the maps
|
||||
// collection of a different mapper than we had previously
|
||||
Metamaps.Maps.Mapper.reset();
|
||||
Metamaps.Maps.Mapper.page = 1;
|
||||
}
|
||||
Metamaps.Maps.Mapper.mapperId = id;
|
||||
}
|
||||
|
||||
Metamaps.Views.exploreMaps.setCollection( Metamaps.Maps[capitalize] );
|
||||
|
||||
var navigate = function(){
|
||||
var path = "/explore/" + Metamaps.currentPage;
|
||||
|
||||
// alter url if for mapper profile page
|
||||
if (Metamaps.currentPage == "mapper") {
|
||||
path += "/" + Metamaps.Maps.Mapper.mapperId;
|
||||
}
|
||||
|
||||
Metamaps.Router.navigate(path);
|
||||
};
|
||||
var navigateTimeout = function() {
|
||||
Metamaps.routerTimeoutId = setTimeout(navigate, 300);
|
||||
};
|
||||
if (Metamaps.Maps[capitalize].length === 0) {
|
||||
Metamaps.Loading.show();
|
||||
setTimeout(function(){
|
||||
Metamaps.Maps[capitalize].getMaps(navigate); // this will trigger an explore maps render
|
||||
}, 300); // wait 300 milliseconds till the other animations are done to do the fetch
|
||||
}
|
||||
else {
|
||||
if (id) {
|
||||
Metamaps.Views.exploreMaps.fetchUserThenRender(navigateTimeout);
|
||||
}
|
||||
else {
|
||||
Metamaps.Views.exploreMaps.render(navigateTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
Metamaps.GlobalUI.Search.open();
|
||||
Metamaps.GlobalUI.Search.lock();
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
|
||||
Metamaps.Famous.maps.resetScroll(); // sets the scroll back to the top
|
||||
Metamaps.Famous.maps.show();
|
||||
Metamaps.Famous.explore.set(section, id);
|
||||
Metamaps.Famous.explore.show();
|
||||
|
||||
Metamaps.Famous.viz.hide();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Map = null;
|
||||
Metamaps.Active.Topic = null;
|
||||
},
|
||||
maps: function (id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
document.title = 'Map ' + id + ' | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "map";
|
||||
Metamaps.currentPage = id;
|
||||
|
||||
$('.wrapper').removeClass('homePage explorePage topicPage');
|
||||
$('.wrapper').addClass('mapPage');
|
||||
// another class will be added to wrapper if you
|
||||
// can edit this map '.canEditMap'
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
// clear the visualization, if there was one, before showing its div again
|
||||
if (Metamaps.Visualize.mGraph) {
|
||||
Metamaps.Visualize.mGraph.graph.empty();
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
|
||||
}
|
||||
Metamaps.Famous.viz.show();
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Active.Topic = null;
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Loading.show();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Map.launch(id);
|
||||
},
|
||||
topics: function (id) {
|
||||
clearTimeout(Metamaps.routerTimeoutId);
|
||||
|
||||
document.title = 'Topic ' + id + ' | Metamaps';
|
||||
|
||||
Metamaps.currentSection = "topic";
|
||||
Metamaps.currentPage = id;
|
||||
|
||||
$('.wrapper').removeClass('homePage explorePage mapPage');
|
||||
$('.wrapper').addClass('topicPage');
|
||||
|
||||
Metamaps.Famous.yield.hide();
|
||||
Metamaps.Famous.maps.hide();
|
||||
Metamaps.Famous.explore.hide();
|
||||
|
||||
// clear the visualization, if there was one, before showing its div again
|
||||
if (Metamaps.Visualize.mGraph) {
|
||||
Metamaps.Visualize.mGraph.graph.empty();
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.JIT.centerMap(Metamaps.Visualize.mGraph.canvas);
|
||||
}
|
||||
Metamaps.Famous.viz.show();
|
||||
Metamaps.Map.end();
|
||||
Metamaps.Active.Map = null;
|
||||
|
||||
Metamaps.GlobalUI.Search.unlock();
|
||||
Metamaps.GlobalUI.Search.close(0, true);
|
||||
|
||||
Metamaps.Topic.end();
|
||||
Metamaps.Topic.launch(id);
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Router = new Router();
|
||||
|
||||
|
||||
Metamaps.Router.intercept = function (evt) {
|
||||
var segments;
|
||||
|
||||
var href = {
|
||||
prop: $(this).prop("href"),
|
||||
attr: $(this).attr("href")
|
||||
};
|
||||
var root = location.protocol + "//" + location.host + Backbone.history.options.root;
|
||||
|
||||
if (href.prop && href.prop === root) href.attr = "";
|
||||
|
||||
if (href.prop && href.prop.slice(0, root.length) === root) {
|
||||
evt.preventDefault();
|
||||
|
||||
segments = href.attr.split('/');
|
||||
segments.splice(0,1); // pop off the element created by the first /
|
||||
|
||||
if (href.attr === "") Metamaps.Router.home();
|
||||
else {
|
||||
Metamaps.Router[segments[0]](segments[1], segments[2]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
silent: true,
|
||||
pushState: true,
|
||||
root: '/'
|
||||
});
|
||||
$(document).on("click", "a:not([data-bypass])", Metamaps.Router.intercept);
|
||||
};
|
||||
})();
|
||||
|
|
|
@ -1,133 +1,133 @@
|
|||
(function () {
|
||||
Metamaps.Views = {};
|
||||
|
||||
var initialized = false;
|
||||
|
||||
Metamaps.Views.init = function () {
|
||||
|
||||
Metamaps.Views.MapperCard = Backbone.View.extend({
|
||||
|
||||
template: Hogan.compile( $('#mapperCardTemplate').html() ),
|
||||
|
||||
tagNamea: "div",
|
||||
|
||||
className: "mapper",
|
||||
|
||||
render: function () {
|
||||
this.$el.html( this.template.render(this.model) );
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Views.MapCard = Backbone.View.extend({
|
||||
|
||||
template: Hogan.compile( $('#mapCardTemplate').html() ),
|
||||
|
||||
tagName: "div",
|
||||
|
||||
className: "map",
|
||||
|
||||
id: function() {
|
||||
return this.model.id;
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.listenTo(this.model, "change", this.render);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html( this.template.render(this.model.attrForCards()) );
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var mapsWrapper = Backbone.View.extend({
|
||||
|
||||
initialize: function (opts) {
|
||||
|
||||
},
|
||||
setCollection: function (collection) {
|
||||
if (this.collection) this.stopListening(this.collection);
|
||||
this.collection = collection;
|
||||
this.listenTo(this.collection, 'add', this.render);
|
||||
this.listenTo(this.collection, 'successOnFetch', this.handleSuccess);
|
||||
this.listenTo(this.collection, 'errorOnFetch', this.handleError);
|
||||
},
|
||||
render: function (mapperObj, cb) {
|
||||
|
||||
var that = this;
|
||||
|
||||
if (typeof mapperObj === "function") {
|
||||
var cb = mapperObj;
|
||||
mapperObj = null;
|
||||
}
|
||||
|
||||
this.el.innerHTML = "";
|
||||
|
||||
// in case it is a page where we have to display the mapper card
|
||||
if (mapperObj) {
|
||||
var view = new Metamaps.Views.MapperCard({ model: mapperObj });
|
||||
|
||||
that.el.appendChild( view.render().el );
|
||||
}
|
||||
|
||||
|
||||
this.collection.each(function (map) {
|
||||
var view = new Metamaps.Views.MapCard({ model: map });
|
||||
|
||||
that.el.appendChild( view.render().el );
|
||||
});
|
||||
this.$el.append('<div class="clearfloat"></div>');
|
||||
var m = Metamaps.Famous.maps.surf;
|
||||
m.setContent(this.el);
|
||||
|
||||
var updateHeight = function(){
|
||||
var height = $(that.el).height() + 32 + 56;
|
||||
m.setSize([undefined, height]);
|
||||
Metamaps.Famous.maps.lock = false;
|
||||
if (cb) cb();
|
||||
};
|
||||
|
||||
if (!initialized) {
|
||||
m.deploy(m._currTarget);
|
||||
initialized = true;
|
||||
setTimeout(updateHeight, 100);
|
||||
} else {
|
||||
setTimeout(updateHeight, 100);
|
||||
}
|
||||
|
||||
Metamaps.Loading.hide();
|
||||
},
|
||||
handleSuccess: function (cb) {
|
||||
var that = this;
|
||||
|
||||
if (this.collection && this.collection.id === "mapper") {
|
||||
this.fetchUserThenRender(cb);
|
||||
}
|
||||
else {
|
||||
this.render(cb);
|
||||
}
|
||||
},
|
||||
handleError: function () {
|
||||
console.log('error loading maps!'); //TODO
|
||||
},
|
||||
fetchUserThenRender: function (cb) {
|
||||
var that = this;
|
||||
// first load the mapper object and then call the render function
|
||||
$.ajax({
|
||||
url: "/users/" + this.collection.mapperId + "/details.json",
|
||||
success: function (response) {
|
||||
that.render(response, cb);
|
||||
},
|
||||
error: function () {
|
||||
that.render(cb);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Views.exploreMaps = new mapsWrapper();
|
||||
};
|
||||
|
||||
})();
|
||||
(function () {
|
||||
Metamaps.Views = {};
|
||||
|
||||
var initialized = false;
|
||||
|
||||
Metamaps.Views.init = function () {
|
||||
|
||||
Metamaps.Views.MapperCard = Backbone.View.extend({
|
||||
|
||||
template: Hogan.compile( $('#mapperCardTemplate').html() ),
|
||||
|
||||
tagNamea: "div",
|
||||
|
||||
className: "mapper",
|
||||
|
||||
render: function () {
|
||||
this.$el.html( this.template.render(this.model) );
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Views.MapCard = Backbone.View.extend({
|
||||
|
||||
template: Hogan.compile( $('#mapCardTemplate').html() ),
|
||||
|
||||
tagName: "div",
|
||||
|
||||
className: "map",
|
||||
|
||||
id: function() {
|
||||
return this.model.id;
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.listenTo(this.model, "change", this.render);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html( this.template.render(this.model.attrForCards()) );
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var mapsWrapper = Backbone.View.extend({
|
||||
|
||||
initialize: function (opts) {
|
||||
|
||||
},
|
||||
setCollection: function (collection) {
|
||||
if (this.collection) this.stopListening(this.collection);
|
||||
this.collection = collection;
|
||||
this.listenTo(this.collection, 'add', this.render);
|
||||
this.listenTo(this.collection, 'successOnFetch', this.handleSuccess);
|
||||
this.listenTo(this.collection, 'errorOnFetch', this.handleError);
|
||||
},
|
||||
render: function (mapperObj, cb) {
|
||||
|
||||
var that = this;
|
||||
|
||||
if (typeof mapperObj === "function") {
|
||||
var cb = mapperObj;
|
||||
mapperObj = null;
|
||||
}
|
||||
|
||||
this.el.innerHTML = "";
|
||||
|
||||
// in case it is a page where we have to display the mapper card
|
||||
if (mapperObj) {
|
||||
var view = new Metamaps.Views.MapperCard({ model: mapperObj });
|
||||
|
||||
that.el.appendChild( view.render().el );
|
||||
}
|
||||
|
||||
|
||||
this.collection.each(function (map) {
|
||||
var view = new Metamaps.Views.MapCard({ model: map });
|
||||
|
||||
that.el.appendChild( view.render().el );
|
||||
});
|
||||
this.$el.append('<div class="clearfloat"></div>');
|
||||
var m = Metamaps.Famous.maps.surf;
|
||||
m.setContent(this.el);
|
||||
|
||||
var updateHeight = function(){
|
||||
var height = $(that.el).height() + 32 + 56;
|
||||
m.setSize([undefined, height]);
|
||||
Metamaps.Famous.maps.lock = false;
|
||||
if (cb) cb();
|
||||
};
|
||||
|
||||
if (!initialized) {
|
||||
m.deploy(m._currTarget);
|
||||
initialized = true;
|
||||
setTimeout(updateHeight, 100);
|
||||
} else {
|
||||
setTimeout(updateHeight, 100);
|
||||
}
|
||||
|
||||
Metamaps.Loading.hide();
|
||||
},
|
||||
handleSuccess: function (cb) {
|
||||
var that = this;
|
||||
|
||||
if (this.collection && this.collection.id === "mapper") {
|
||||
this.fetchUserThenRender(cb);
|
||||
}
|
||||
else {
|
||||
this.render(cb);
|
||||
}
|
||||
},
|
||||
handleError: function () {
|
||||
console.log('error loading maps!'); //TODO
|
||||
},
|
||||
fetchUserThenRender: function (cb) {
|
||||
var that = this;
|
||||
// first load the mapper object and then call the render function
|
||||
$.ajax({
|
||||
url: "/users/" + this.collection.mapperId + "/details.json",
|
||||
success: function (response) {
|
||||
that.render(response, cb);
|
||||
},
|
||||
error: function () {
|
||||
that.render(cb);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Metamaps.Views.exploreMaps = new mapsWrapper();
|
||||
};
|
||||
|
||||
})();
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,474 +1,474 @@
|
|||
/*! jQuery UI - v1.9.2 - 2012-11-23
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
|
||||
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.ui-helper-clearfix:after { clear: both; }
|
||||
.ui-helper-clearfix { zoom: 1; }
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}
|
||||
.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-topic { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-topic a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-topic a.ui-state-focus,
|
||||
.ui-menu .ui-menu-topic a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-topic a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
||||
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(<%= asset_data_uri('ui-bg_flat_75_ffffff_40x100.png') %>)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
|
||||
.ui-widget-content a { color: #222222/*{fcContent}*/; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(<%= asset_data_uri('images/ui-bg_highlight-soft_75_cccccc_1x100.png') %>)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(<%= asset_data_uri('images/ui-bg_glass_75_e6e6e6_1x400.png') %>)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 0px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(<%= asset_data_uri('images/ui-bg_glass_75_dadada_1x400.png') %>)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121/*{fcHover}*/; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(<%= asset_data_uri('images/ui-bg_glass_65_ffffff_1x400.png') %>)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(<%= asset_data_uri('images/ui-bg_glass_55_fbf9ee_1x400.png') %>)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(<%= asset_data_uri('images/ui-bg_glass_95_fef1ec_1x400.png') %>)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsContent}*/; }
|
||||
.ui-widget-content .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsContent}*/; }
|
||||
.ui-widget-header .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsHeader}*/; }
|
||||
.ui-state-default .ui-icon { background-image: url(<%= asset_data_uri('images/ui-icons_888888_256x240.png') %>)/*{iconsDefault}*/; }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_454545_256x240.png') %>)/*{iconsHover}*/; }
|
||||
.ui-state-active .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_454545_256x240.png') %>)/*{iconsActive}*/; }
|
||||
.ui-state-highlight .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_2e83ff_256x240.png') %>)/*{iconsHighlight}*/; }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_cd0a0a_256x240.png') %>)/*{iconsError}*/; }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(<%= asset_data_uri('images/ui-bg_flat_0_aaaaaa_40x100.png') %>)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
|
||||
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/<%= asset_data_uri('ui-bg_flat_0_aaaaaa_40x100.png') %>)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
|
||||
/*! jQuery UI - v1.9.2 - 2012-11-23
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
|
||||
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.ui-helper-clearfix:after { clear: both; }
|
||||
.ui-helper-clearfix { zoom: 1; }
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}
|
||||
.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-topic { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-topic a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-topic a.ui-state-focus,
|
||||
.ui-menu .ui-menu-topic a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-topic a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
||||
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(<%= asset_data_uri('ui-bg_flat_75_ffffff_40x100.png') %>)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
|
||||
.ui-widget-content a { color: #222222/*{fcContent}*/; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(<%= asset_data_uri('images/ui-bg_highlight-soft_75_cccccc_1x100.png') %>)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(<%= asset_data_uri('images/ui-bg_glass_75_e6e6e6_1x400.png') %>)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 0px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(<%= asset_data_uri('images/ui-bg_glass_75_dadada_1x400.png') %>)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121/*{fcHover}*/; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(<%= asset_data_uri('images/ui-bg_glass_65_ffffff_1x400.png') %>)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(<%= asset_data_uri('images/ui-bg_glass_55_fbf9ee_1x400.png') %>)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(<%= asset_data_uri('images/ui-bg_glass_95_fef1ec_1x400.png') %>)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsContent}*/; }
|
||||
.ui-widget-content .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsContent}*/; }
|
||||
.ui-widget-header .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_222222_256x240.png') %>)/*{iconsHeader}*/; }
|
||||
.ui-state-default .ui-icon { background-image: url(<%= asset_data_uri('images/ui-icons_888888_256x240.png') %>)/*{iconsDefault}*/; }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_454545_256x240.png') %>)/*{iconsHover}*/; }
|
||||
.ui-state-active .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_454545_256x240.png') %>)/*{iconsActive}*/; }
|
||||
.ui-state-highlight .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_2e83ff_256x240.png') %>)/*{iconsHighlight}*/; }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(<%= asset_data_uri('images/ui-icons_cd0a0a_256x240.png') %>)/*{iconsError}*/; }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(<%= asset_data_uri('images/ui-bg_flat_0_aaaaaa_40x100.png') %>)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
|
||||
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/<%= asset_data_uri('ui-bg_flat_0_aaaaaa_40x100.png') %>)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
|
||||
|
|
|
@ -1,473 +1,473 @@
|
|||
/* basic scrollbar styling */
|
||||
/* vertical scrollbar */
|
||||
.mCSB_container{
|
||||
width:auto;
|
||||
margin-right:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
}
|
||||
.mCS_disabled>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:30px;
|
||||
}
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:16px;
|
||||
height:100%;
|
||||
top:0;
|
||||
right:0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerContainer{
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
height:auto;
|
||||
}
|
||||
.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:20px 0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:2px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger{
|
||||
cursor:pointer;
|
||||
width:100%;
|
||||
height:30px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
text-align:center;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
display:block;
|
||||
position:relative;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
top:100%;
|
||||
margin-top:-40px;
|
||||
}
|
||||
/* horizontal scrollbar */
|
||||
.mCSB_horizontal>.mCSB_container{
|
||||
height:auto;
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-bottom:0;
|
||||
}
|
||||
.mCS_disabled>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.mCSB_horizontal.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:100%;
|
||||
height:16px;
|
||||
top:auto;
|
||||
right:auto;
|
||||
bottom:0;
|
||||
left:0;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:0 20px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px 0;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger{
|
||||
width:30px;
|
||||
height:100%;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
display:block;
|
||||
position:relative;
|
||||
width:20px;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
float:left;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
margin-left:-40px;
|
||||
float:right;
|
||||
}
|
||||
.mCustomScrollBox{
|
||||
-ms-touch-action:none; /*MSPointer events - direct all pointer events to js*/
|
||||
}
|
||||
|
||||
/* default scrollbar colors and backgrounds (default theme) */
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCustomScrollBox:hover>.mCSB_scrollTools{
|
||||
opacity:1;
|
||||
filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.4);
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
filter:"alpha(opacity=85)"; -ms-filter:"alpha(opacity=85)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-repeat:no-repeat;
|
||||
opacity:0.4;
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:0 0;
|
||||
/*
|
||||
sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:0 -20px;
|
||||
/*
|
||||
sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:0 -40px;
|
||||
/*
|
||||
sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:0 -56px;
|
||||
/*
|
||||
sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:hover{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:active,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:active,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:active,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:active{
|
||||
opacity:0.9;
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
|
||||
/*scrollbar themes*/
|
||||
/*dark (dark colored scrollbar)*/
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
/*light-2*/
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-32px 0;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-32px -20px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-40px -40px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-40px -56px;
|
||||
}
|
||||
/*dark-2*/
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-112px 0;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-112px -20px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-120px -40px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-120px -56px;
|
||||
}
|
||||
/*light-thick*/
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-16px 0;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-16px -20px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-20px -40px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-20px -56px;
|
||||
}
|
||||
/*dark-thick*/
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-96px 0;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-96px -20px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-100px -40px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-100px -56px;
|
||||
}
|
||||
/*light-thin*/
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
}
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
/*dark-thin*/
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
/* basic scrollbar styling */
|
||||
/* vertical scrollbar */
|
||||
.mCSB_container{
|
||||
width:auto;
|
||||
margin-right:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
}
|
||||
.mCS_disabled>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:30px;
|
||||
}
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:16px;
|
||||
height:100%;
|
||||
top:0;
|
||||
right:0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerContainer{
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
height:auto;
|
||||
}
|
||||
.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:20px 0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:2px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger{
|
||||
cursor:pointer;
|
||||
width:100%;
|
||||
height:30px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
text-align:center;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
display:block;
|
||||
position:relative;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
top:100%;
|
||||
margin-top:-40px;
|
||||
}
|
||||
/* horizontal scrollbar */
|
||||
.mCSB_horizontal>.mCSB_container{
|
||||
height:auto;
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-bottom:0;
|
||||
}
|
||||
.mCS_disabled>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.mCSB_horizontal.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:100%;
|
||||
height:16px;
|
||||
top:auto;
|
||||
right:auto;
|
||||
bottom:0;
|
||||
left:0;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:0 20px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px 0;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger{
|
||||
width:30px;
|
||||
height:100%;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
display:block;
|
||||
position:relative;
|
||||
width:20px;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
float:left;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
margin-left:-40px;
|
||||
float:right;
|
||||
}
|
||||
.mCustomScrollBox{
|
||||
-ms-touch-action:none; /*MSPointer events - direct all pointer events to js*/
|
||||
}
|
||||
|
||||
/* default scrollbar colors and backgrounds (default theme) */
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCustomScrollBox:hover>.mCSB_scrollTools{
|
||||
opacity:1;
|
||||
filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.4);
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
filter:"alpha(opacity=85)"; -ms-filter:"alpha(opacity=85)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-repeat:no-repeat;
|
||||
opacity:0.4;
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:0 0;
|
||||
/*
|
||||
sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:0 -20px;
|
||||
/*
|
||||
sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:0 -40px;
|
||||
/*
|
||||
sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:0 -56px;
|
||||
/*
|
||||
sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:hover{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:active,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:active,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:active,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:active{
|
||||
opacity:0.9;
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
|
||||
/*scrollbar themes*/
|
||||
/*dark (dark colored scrollbar)*/
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
/*light-2*/
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-32px 0;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-32px -20px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-40px -40px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-40px -56px;
|
||||
}
|
||||
/*dark-2*/
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-112px 0;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-112px -20px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-120px -40px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-120px -56px;
|
||||
}
|
||||
/*light-thick*/
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-16px 0;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-16px -20px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-20px -40px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-20px -56px;
|
||||
}
|
||||
/*dark-thick*/
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-96px 0;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-96px -20px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-100px -40px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-100px -56px;
|
||||
}
|
||||
/*light-thin*/
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
}
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
/*dark-thin*/
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
|
|
|
@ -1,215 +1,215 @@
|
|||
class TopicsController < ApplicationController
|
||||
include TopicsHelper
|
||||
|
||||
before_filter :require_user, only: [:create, :update, :destroy]
|
||||
|
||||
respond_to :html, :js, :json
|
||||
|
||||
# GET /topics/autocomplete_topic
|
||||
def autocomplete_topic
|
||||
@current = current_user
|
||||
term = params[:term]
|
||||
if term && !term.empty?
|
||||
@topics = Topic.where('LOWER("name") like ?', term.downcase + '%').order('"name"')
|
||||
|
||||
#read this next line as 'delete a topic if its private and you're either
|
||||
#1. logged out or 2. logged in but not the topic creator
|
||||
@topics.to_a.delete_if {|t| t.permission == "private" &&
|
||||
(!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||
else
|
||||
@topics = []
|
||||
end
|
||||
render json: autocomplete_array_json(@topics)
|
||||
end
|
||||
|
||||
# GET topics/:id
|
||||
def show
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@alltopics = ([@topic] + @topic.relatives).delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) } # should limit to topics visible to user
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||
|
||||
@allcreators = []
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
respond_with(@allsynapses, @alltopics, @allcreators, @topic)
|
||||
}
|
||||
format.json { render json: @topic }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/network
|
||||
def network
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||
@allcreators = []
|
||||
@allcreators.push(@topic.user)
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
@json = Hash.new()
|
||||
@json['topic'] = @topic
|
||||
@json['creators'] = @allcreators
|
||||
@json['relatives'] = @alltopics
|
||||
@json['synapses'] = @allsynapses
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/relative_numbers
|
||||
def relative_numbers
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@topicsAlreadyHas = params[:network] ? params[:network].split(',') : []
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t|
|
||||
@topicsAlreadyHas.index(t.id.to_s) != nil ||
|
||||
(t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)))
|
||||
}
|
||||
|
||||
@alltopics.uniq!
|
||||
|
||||
@json = Hash.new()
|
||||
@alltopics.each do |t|
|
||||
if @json[t.metacode.id]
|
||||
@json[t.metacode.id] += 1
|
||||
else
|
||||
@json[t.metacode.id] = 1
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/relatives
|
||||
def relatives
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@topicsAlreadyHas = params[:network] ? params[:network].split(',') : []
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t|
|
||||
@topicsAlreadyHas.index(t.id.to_s) != nil ||
|
||||
(params[:metacode] && t.metacode_id.to_s != params[:metacode]) ||
|
||||
(t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)))
|
||||
}
|
||||
|
||||
@alltopics.uniq!
|
||||
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s|
|
||||
(s.topic1 == @topic && @alltopics.index(s.topic2) == nil) ||
|
||||
(s.topic2 == @topic && @alltopics.index(s.topic1) == nil)
|
||||
}
|
||||
|
||||
@creatorsAlreadyHas = params[:creators] ? params[:creators].split(',') : []
|
||||
@allcreators = []
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil && @creatorsAlreadyHas.index(t.user_id.to_s) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil && @creatorsAlreadyHas.index(s.user_id.to_s) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
@json = Hash.new()
|
||||
@json['topics'] = @alltopics
|
||||
@json['synapses'] = @allsynapses
|
||||
@json['creators'] = @allcreators
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# POST /topics
|
||||
# POST /topics.json
|
||||
def create
|
||||
@topic = Topic.new(topic_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @topic.save
|
||||
format.json { render json: @topic, status: :created }
|
||||
else
|
||||
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /topics/1
|
||||
# PUT /topics/1.json
|
||||
def update
|
||||
@topic = Topic.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @topic.update_attributes(topic_params)
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE topics/:id
|
||||
def destroy
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_delete(@current)
|
||||
@topic.delete if @topic
|
||||
|
||||
respond_to do |format|
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic_params
|
||||
params.require(:topic).permit(:id, :name, :desc, :link, :permission, :user_id, :metacode_id)
|
||||
end
|
||||
end
|
||||
class TopicsController < ApplicationController
|
||||
include TopicsHelper
|
||||
|
||||
before_filter :require_user, only: [:create, :update, :destroy]
|
||||
|
||||
respond_to :html, :js, :json
|
||||
|
||||
# GET /topics/autocomplete_topic
|
||||
def autocomplete_topic
|
||||
@current = current_user
|
||||
term = params[:term]
|
||||
if term && !term.empty?
|
||||
@topics = Topic.where('LOWER("name") like ?', term.downcase + '%').order('"name"')
|
||||
|
||||
#read this next line as 'delete a topic if its private and you're either
|
||||
#1. logged out or 2. logged in but not the topic creator
|
||||
@topics.to_a.delete_if {|t| t.permission == "private" &&
|
||||
(!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||
else
|
||||
@topics = []
|
||||
end
|
||||
render json: autocomplete_array_json(@topics)
|
||||
end
|
||||
|
||||
# GET topics/:id
|
||||
def show
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@alltopics = ([@topic] + @topic.relatives).delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) } # should limit to topics visible to user
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||
|
||||
@allcreators = []
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
respond_with(@allsynapses, @alltopics, @allcreators, @topic)
|
||||
}
|
||||
format.json { render json: @topic }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/network
|
||||
def network
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t| t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)) }
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s| s.permission == "private" && (!authenticated? || (authenticated? && @current.id != s.user_id)) }
|
||||
@allcreators = []
|
||||
@allcreators.push(@topic.user)
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
@json = Hash.new()
|
||||
@json['topic'] = @topic
|
||||
@json['creators'] = @allcreators
|
||||
@json['relatives'] = @alltopics
|
||||
@json['synapses'] = @allsynapses
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/relative_numbers
|
||||
def relative_numbers
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@topicsAlreadyHas = params[:network] ? params[:network].split(',') : []
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t|
|
||||
@topicsAlreadyHas.index(t.id.to_s) != nil ||
|
||||
(t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)))
|
||||
}
|
||||
|
||||
@alltopics.uniq!
|
||||
|
||||
@json = Hash.new()
|
||||
@alltopics.each do |t|
|
||||
if @json[t.metacode.id]
|
||||
@json[t.metacode.id] += 1
|
||||
else
|
||||
@json[t.metacode.id] = 1
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# GET topics/:id/relatives
|
||||
def relatives
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_show(@current)
|
||||
|
||||
if not @topic
|
||||
redirect_to root_url, notice: "Access denied. That topic is private." and return
|
||||
end
|
||||
|
||||
@topicsAlreadyHas = params[:network] ? params[:network].split(',') : []
|
||||
|
||||
@alltopics = @topic.relatives.to_a.delete_if {|t|
|
||||
@topicsAlreadyHas.index(t.id.to_s) != nil ||
|
||||
(params[:metacode] && t.metacode_id.to_s != params[:metacode]) ||
|
||||
(t.permission == "private" && (!authenticated? || (authenticated? && @current.id != t.user_id)))
|
||||
}
|
||||
|
||||
@alltopics.uniq!
|
||||
|
||||
@allsynapses = @topic.synapses.to_a.delete_if {|s|
|
||||
(s.topic1 == @topic && @alltopics.index(s.topic2) == nil) ||
|
||||
(s.topic2 == @topic && @alltopics.index(s.topic1) == nil)
|
||||
}
|
||||
|
||||
@creatorsAlreadyHas = params[:creators] ? params[:creators].split(',') : []
|
||||
@allcreators = []
|
||||
@alltopics.each do |t|
|
||||
if @allcreators.index(t.user) == nil && @creatorsAlreadyHas.index(t.user_id.to_s) == nil
|
||||
@allcreators.push(t.user)
|
||||
end
|
||||
end
|
||||
@allsynapses.each do |s|
|
||||
if @allcreators.index(s.user) == nil && @creatorsAlreadyHas.index(s.user_id.to_s) == nil
|
||||
@allcreators.push(s.user)
|
||||
end
|
||||
end
|
||||
|
||||
@json = Hash.new()
|
||||
@json['topics'] = @alltopics
|
||||
@json['synapses'] = @allsynapses
|
||||
@json['creators'] = @allcreators
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @json }
|
||||
end
|
||||
end
|
||||
|
||||
# POST /topics
|
||||
# POST /topics.json
|
||||
def create
|
||||
@topic = Topic.new(topic_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @topic.save
|
||||
format.json { render json: @topic, status: :created }
|
||||
else
|
||||
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /topics/1
|
||||
# PUT /topics/1.json
|
||||
def update
|
||||
@topic = Topic.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @topic.update_attributes(topic_params)
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE topics/:id
|
||||
def destroy
|
||||
@current = current_user
|
||||
@topic = Topic.find(params[:id]).authorize_to_delete(@current)
|
||||
@topic.delete if @topic
|
||||
|
||||
respond_to do |format|
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic_params
|
||||
params.require(:topic).permit(:id, :name, :desc, :link, :permission, :user_id, :metacode_id)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,117 +1,117 @@
|
|||
class Topic < ActiveRecord::Base
|
||||
include TopicsHelper
|
||||
|
||||
belongs_to :user
|
||||
|
||||
has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id', dependent: :destroy
|
||||
has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id', dependent: :destroy
|
||||
has_many :topics1, :through => :synapses2, :source => :topic1
|
||||
has_many :topics2, :through => :synapses1, :source => :topic2
|
||||
|
||||
has_many :mappings, as: :mappable, dependent: :destroy
|
||||
has_many :maps, :through => :mappings
|
||||
|
||||
validates :permission, presence: true
|
||||
validates :permission, inclusion: { in: Perm::ISSIONS.map(&:to_s) }
|
||||
|
||||
# This method associates the attribute ":image" with a file attachment
|
||||
has_attached_file :image
|
||||
|
||||
#, styles: {
|
||||
# thumb: '100x100>',
|
||||
# square: '200x200#',
|
||||
# medium: '300x300>'
|
||||
#}
|
||||
|
||||
# Validate the attached image is image/jpg, image/png, etc
|
||||
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
|
||||
|
||||
# This method associates the attribute ":image" with a file attachment
|
||||
has_attached_file :audio
|
||||
# Validate the attached audio is audio/wav, audio/mp3, etc
|
||||
validates_attachment_content_type :audio, :content_type => /\Aaudio\/.*\Z/
|
||||
|
||||
def synapses
|
||||
synapses1 + synapses2
|
||||
end
|
||||
|
||||
def relatives
|
||||
topics1 + topics2
|
||||
end
|
||||
|
||||
belongs_to :metacode
|
||||
|
||||
def user_name
|
||||
user.name
|
||||
end
|
||||
|
||||
def user_image
|
||||
user.image.url
|
||||
end
|
||||
|
||||
def map_count
|
||||
maps.count
|
||||
end
|
||||
|
||||
def synapse_count
|
||||
synapses.count
|
||||
end
|
||||
|
||||
def inmaps
|
||||
maps.map(&:name)
|
||||
end
|
||||
|
||||
def inmapsLinks
|
||||
maps.map(&:id)
|
||||
end
|
||||
|
||||
def as_json(options={})
|
||||
super(:methods =>[:user_name, :user_image, :map_count, :synapse_count, :inmaps, :inmapsLinks])
|
||||
end
|
||||
|
||||
def topic_autocomplete_method
|
||||
"Get: #{self.name}"
|
||||
end
|
||||
|
||||
def mk_permission
|
||||
Perm.short(permission)
|
||||
end
|
||||
|
||||
# has no viewable synapses helper function
|
||||
def has_viewable_synapses(current)
|
||||
result = false
|
||||
synapses.each do |synapse|
|
||||
if synapse.authorize_to_show(current)
|
||||
result = true
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
##### PERMISSIONS ######
|
||||
|
||||
# returns false if user not allowed to 'show' Topic, Synapse, or Map
|
||||
def authorize_to_show(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
# returns false if user not allowed to 'edit' Topic, Synapse, or Map
|
||||
def authorize_to_edit(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
elsif (self.permission == "public" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
def authorize_to_delete(user)
|
||||
if (self.user == user || user.admin)
|
||||
return self
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
class Topic < ActiveRecord::Base
|
||||
include TopicsHelper
|
||||
|
||||
belongs_to :user
|
||||
|
||||
has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id', dependent: :destroy
|
||||
has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id', dependent: :destroy
|
||||
has_many :topics1, :through => :synapses2, :source => :topic1
|
||||
has_many :topics2, :through => :synapses1, :source => :topic2
|
||||
|
||||
has_many :mappings, as: :mappable, dependent: :destroy
|
||||
has_many :maps, :through => :mappings
|
||||
|
||||
validates :permission, presence: true
|
||||
validates :permission, inclusion: { in: Perm::ISSIONS.map(&:to_s) }
|
||||
|
||||
# This method associates the attribute ":image" with a file attachment
|
||||
has_attached_file :image
|
||||
|
||||
#, styles: {
|
||||
# thumb: '100x100>',
|
||||
# square: '200x200#',
|
||||
# medium: '300x300>'
|
||||
#}
|
||||
|
||||
# Validate the attached image is image/jpg, image/png, etc
|
||||
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
|
||||
|
||||
# This method associates the attribute ":image" with a file attachment
|
||||
has_attached_file :audio
|
||||
# Validate the attached audio is audio/wav, audio/mp3, etc
|
||||
validates_attachment_content_type :audio, :content_type => /\Aaudio\/.*\Z/
|
||||
|
||||
def synapses
|
||||
synapses1 + synapses2
|
||||
end
|
||||
|
||||
def relatives
|
||||
topics1 + topics2
|
||||
end
|
||||
|
||||
belongs_to :metacode
|
||||
|
||||
def user_name
|
||||
user.name
|
||||
end
|
||||
|
||||
def user_image
|
||||
user.image.url
|
||||
end
|
||||
|
||||
def map_count
|
||||
maps.count
|
||||
end
|
||||
|
||||
def synapse_count
|
||||
synapses.count
|
||||
end
|
||||
|
||||
def inmaps
|
||||
maps.map(&:name)
|
||||
end
|
||||
|
||||
def inmapsLinks
|
||||
maps.map(&:id)
|
||||
end
|
||||
|
||||
def as_json(options={})
|
||||
super(:methods =>[:user_name, :user_image, :map_count, :synapse_count, :inmaps, :inmapsLinks])
|
||||
end
|
||||
|
||||
def topic_autocomplete_method
|
||||
"Get: #{self.name}"
|
||||
end
|
||||
|
||||
def mk_permission
|
||||
Perm.short(permission)
|
||||
end
|
||||
|
||||
# has no viewable synapses helper function
|
||||
def has_viewable_synapses(current)
|
||||
result = false
|
||||
synapses.each do |synapse|
|
||||
if synapse.authorize_to_show(current)
|
||||
result = true
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
##### PERMISSIONS ######
|
||||
|
||||
# returns false if user not allowed to 'show' Topic, Synapse, or Map
|
||||
def authorize_to_show(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
# returns false if user not allowed to 'edit' Topic, Synapse, or Map
|
||||
def authorize_to_edit(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
elsif (self.permission == "public" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
def authorize_to_delete(user)
|
||||
if (self.user == user || user.admin)
|
||||
return self
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
class UserPreference
|
||||
attr_accessor :metacodes
|
||||
|
||||
def initialize
|
||||
array = []
|
||||
Metacode.all.each do |m|
|
||||
array.push(m.id.to_s)
|
||||
end
|
||||
@metacodes = array
|
||||
end
|
||||
class UserPreference
|
||||
attr_accessor :metacodes
|
||||
|
||||
def initialize
|
||||
array = []
|
||||
Metacode.all.each do |m|
|
||||
array.push(m.id.to_s)
|
||||
end
|
||||
@metacodes = array
|
||||
end
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
<%= link_to 'Metacode Sets', metacode_sets_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'New Set', new_metacode_set_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'Metacodes', metacodes_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'New Metacode', new_metacode_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<div class='clearfloat'></div>
|
||||
<br />
|
||||
<%= link_to 'Metacode Sets', metacode_sets_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'New Set', new_metacode_set_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'Metacodes', metacodes_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<%= link_to 'New Metacode', new_metacode_path, { :class => 'button', 'data-bypass' => 'true' }%>
|
||||
<div class='clearfloat'></div>
|
||||
<br />
|
||||
|
|
|
@ -1,152 +1,152 @@
|
|||
<%#
|
||||
# @file
|
||||
# Main application file. Holds scaffolding present on every page.
|
||||
# Then a certain non-partial view (no _ preceding filename) will be
|
||||
# displayed within, based on URL
|
||||
#%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%=h yield(:title) %></title>
|
||||
<%= csrf_meta_tags %>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
|
||||
<!-- typekit for vinyl font -->
|
||||
<script type="text/javascript" src="https://use.typekit.net/tki2nyo.js"></script>
|
||||
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
|
||||
|
||||
<!-- app code -->
|
||||
<script type="text/javascript">
|
||||
require.config({baseUrl: '<%= "#{ asset_path '/famous/main.js' }".chomp('main.js') %>'});
|
||||
require(['main']);
|
||||
</script>
|
||||
|
||||
<!--[if (IE)]>
|
||||
<style type="text/css">
|
||||
#lightbox_overlay {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#lightbox_main {
|
||||
top: 50%;
|
||||
margin-top: -281px;
|
||||
}
|
||||
|
||||
#lightbox_screen {
|
||||
height: 100%;
|
||||
opacity: 0.42;
|
||||
}
|
||||
|
||||
.lightboxContent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#noIE {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#lightbox_close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#lightbox_screen").unbind().click(function(event){
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body class="<%= authenticated? ? "authenticated" : "unauthenticated" %>">
|
||||
|
||||
<% if devise_error_messages? %>
|
||||
<p id="toast"><%= devise_error_messages! %></p>
|
||||
<% elsif notice %>
|
||||
<p id="toast"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :div, class: "main" do %>
|
||||
|
||||
<% classes = action_name == "home" ? "homePage" : ""
|
||||
classes += action_name == "home" && authenticated? ? " explorePage" : ""
|
||||
classes += controller_name == "maps" && action_name == "index" ? " explorePage" : ""
|
||||
if controller_name == "maps" && action_name == "show"
|
||||
classes += " mapPage"
|
||||
if @map.authorize_to_edit(current_user)
|
||||
classes += " canEditMap"
|
||||
end
|
||||
if @map.permission == "commons"
|
||||
classes += " commonsMap"
|
||||
end
|
||||
end
|
||||
classes += controller_name == "topics" && action_name == "show" ? " topicPage" : ""
|
||||
%>
|
||||
|
||||
<div class="wrapper <%= classes %>" id="wrapper">
|
||||
|
||||
<%= render :partial => 'layouts/upperelements' %>
|
||||
|
||||
<%= yield %>
|
||||
|
||||
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
|
||||
<% if authenticated? %>
|
||||
<% # for creating and pulling in topics and synapses %>
|
||||
<%= render :partial => 'maps/newtopic' %>
|
||||
<%= render :partial => 'maps/newsynapse' %>
|
||||
<% # for populating the change metacode list on the topic card %>
|
||||
<%= render :partial => 'shared/metacodeoptions' %>
|
||||
<% end %>
|
||||
<%= render :partial => 'layouts/lowermapelements' %>
|
||||
|
||||
<div id="famousOverlay"></div>
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'layouts/lightboxes' %>
|
||||
<%= render :partial => 'layouts/templates' %>
|
||||
<%= render :partial => 'shared/metacodeBgColors' %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
<% if authenticated? %>
|
||||
Metamaps.Active.Mapper = <%= user.to_json.html_safe %>
|
||||
<% else %>
|
||||
Metamaps.Active.Mapper = null;
|
||||
<% end %>
|
||||
Metamaps.Metacodes = <%= Metacode.all.to_json.html_safe %>;
|
||||
|
||||
Metamaps.Loading = {
|
||||
loader: new CanvasLoader('loading'),
|
||||
hide: function () {
|
||||
$('#loading').hide();
|
||||
},
|
||||
show: function () {
|
||||
$('#loading').show();
|
||||
}
|
||||
};
|
||||
Metamaps.Loading.loader.setColor('#4fb5c0'); // default is '#000000'
|
||||
Metamaps.Loading.loader.setDiameter(28); // default is 40
|
||||
Metamaps.Loading.loader.setDensity(41); // default is 40
|
||||
Metamaps.Loading.loader.setRange(0.9); // default is 1.3
|
||||
Metamaps.Loading.loader.show(); // Hidden by default
|
||||
|
||||
// set up uservoice with signed in user
|
||||
<% if authenticated? && ENV['SSO_KEY'] %>
|
||||
USERVOICE.load(Metamaps.Active.Mapper.name, Metamaps.Active.Mapper.id, "<%= user.email %>", "<%= current_sso_token %>");
|
||||
<% else %>
|
||||
USERVOICE.load();
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %>
|
||||
</body>
|
||||
</html>
|
||||
<%#
|
||||
# @file
|
||||
# Main application file. Holds scaffolding present on every page.
|
||||
# Then a certain non-partial view (no _ preceding filename) will be
|
||||
# displayed within, based on URL
|
||||
#%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%=h yield(:title) %></title>
|
||||
<%= csrf_meta_tags %>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
|
||||
<!-- typekit for vinyl font -->
|
||||
<script type="text/javascript" src="https://use.typekit.net/tki2nyo.js"></script>
|
||||
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
|
||||
|
||||
<!-- app code -->
|
||||
<script type="text/javascript">
|
||||
require.config({baseUrl: '<%= "#{ asset_path '/famous/main.js' }".chomp('main.js') %>'});
|
||||
require(['main']);
|
||||
</script>
|
||||
|
||||
<!--[if (IE)]>
|
||||
<style type="text/css">
|
||||
#lightbox_overlay {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#lightbox_main {
|
||||
top: 50%;
|
||||
margin-top: -281px;
|
||||
}
|
||||
|
||||
#lightbox_screen {
|
||||
height: 100%;
|
||||
opacity: 0.42;
|
||||
}
|
||||
|
||||
.lightboxContent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#noIE {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#lightbox_close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#lightbox_screen").unbind().click(function(event){
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body class="<%= authenticated? ? "authenticated" : "unauthenticated" %>">
|
||||
|
||||
<% if devise_error_messages? %>
|
||||
<p id="toast"><%= devise_error_messages! %></p>
|
||||
<% elsif notice %>
|
||||
<p id="toast"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :div, class: "main" do %>
|
||||
|
||||
<% classes = action_name == "home" ? "homePage" : ""
|
||||
classes += action_name == "home" && authenticated? ? " explorePage" : ""
|
||||
classes += controller_name == "maps" && action_name == "index" ? " explorePage" : ""
|
||||
if controller_name == "maps" && action_name == "show"
|
||||
classes += " mapPage"
|
||||
if @map.authorize_to_edit(current_user)
|
||||
classes += " canEditMap"
|
||||
end
|
||||
if @map.permission == "commons"
|
||||
classes += " commonsMap"
|
||||
end
|
||||
end
|
||||
classes += controller_name == "topics" && action_name == "show" ? " topicPage" : ""
|
||||
%>
|
||||
|
||||
<div class="wrapper <%= classes %>" id="wrapper">
|
||||
|
||||
<%= render :partial => 'layouts/upperelements' %>
|
||||
|
||||
<%= yield %>
|
||||
|
||||
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
|
||||
<% if authenticated? %>
|
||||
<% # for creating and pulling in topics and synapses %>
|
||||
<%= render :partial => 'maps/newtopic' %>
|
||||
<%= render :partial => 'maps/newsynapse' %>
|
||||
<% # for populating the change metacode list on the topic card %>
|
||||
<%= render :partial => 'shared/metacodeoptions' %>
|
||||
<% end %>
|
||||
<%= render :partial => 'layouts/lowermapelements' %>
|
||||
|
||||
<div id="famousOverlay"></div>
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'layouts/lightboxes' %>
|
||||
<%= render :partial => 'layouts/templates' %>
|
||||
<%= render :partial => 'shared/metacodeBgColors' %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
<% if authenticated? %>
|
||||
Metamaps.Active.Mapper = <%= user.to_json.html_safe %>
|
||||
<% else %>
|
||||
Metamaps.Active.Mapper = null;
|
||||
<% end %>
|
||||
Metamaps.Metacodes = <%= Metacode.all.to_json.html_safe %>;
|
||||
|
||||
Metamaps.Loading = {
|
||||
loader: new CanvasLoader('loading'),
|
||||
hide: function () {
|
||||
$('#loading').hide();
|
||||
},
|
||||
show: function () {
|
||||
$('#loading').show();
|
||||
}
|
||||
};
|
||||
Metamaps.Loading.loader.setColor('#4fb5c0'); // default is '#000000'
|
||||
Metamaps.Loading.loader.setDiameter(28); // default is 40
|
||||
Metamaps.Loading.loader.setDensity(41); // default is 40
|
||||
Metamaps.Loading.loader.setRange(0.9); // default is 1.3
|
||||
Metamaps.Loading.loader.show(); // Hidden by default
|
||||
|
||||
// set up uservoice with signed in user
|
||||
<% if authenticated? && ENV['SSO_KEY'] %>
|
||||
USERVOICE.load(Metamaps.Active.Mapper.name, Metamaps.Active.Mapper.id, "<%= user.email %>", "<%= current_sso_token %>");
|
||||
<% else %>
|
||||
USERVOICE.load();
|
||||
<% end %>
|
||||
</script>
|
||||
|
||||
<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
|
||||
<%= form.text_field :desc, :placeholder => "describe the connection..." %>
|
||||
<% end %>
|
||||
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
|
||||
<%= form.text_field :desc, :placeholder => "describe the connection..." %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<%#
|
||||
# @file
|
||||
# Partial for rendered a new synapse form
|
||||
# TODO: Is this used? Where?
|
||||
#%>
|
||||
<div class="anypage">
|
||||
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
|
||||
<%= form.text_field :desc, :placeholder => "describe the connection..." %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%#
|
||||
# @file
|
||||
# Partial for rendered a new synapse form
|
||||
# TODO: Is this used? Where?
|
||||
#%>
|
||||
<div class="anypage">
|
||||
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
|
||||
<%= form.text_field :desc, :placeholder => "describe the connection..." %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
default: &default
|
||||
min_messages: WARNING
|
||||
encoding: unicode
|
||||
pool: 5
|
||||
adapter: postgresql
|
||||
host: <%= ENV['DB_HOST'] %>
|
||||
port: <%= ENV['DB_PORT'] %>
|
||||
username: <%= ENV['DB_USERNAME'] %>
|
||||
password: <%= ENV['DB_PASSWORD'] %>
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_development
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_test
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_production
|
||||
default: &default
|
||||
min_messages: WARNING
|
||||
encoding: unicode
|
||||
pool: 5
|
||||
adapter: postgresql
|
||||
host: <%= ENV['DB_HOST'] %>
|
||||
port: <%= ENV['DB_PORT'] %>
|
||||
username: <%= ENV['DB_USERNAME'] %>
|
||||
password: <%= ENV['DB_PASSWORD'] %>
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_development
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_test
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] %>_production
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
|
||||
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
|
||||
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
|
|
@ -1,7 +1,7 @@
|
|||
require 'uservoice-ruby'
|
||||
|
||||
def current_sso_token
|
||||
@current_sso_token ||= UserVoice.generate_sso_token('metamapscc', ENV['SSO_KEY'], {
|
||||
:email => current_user.email
|
||||
}, 300) # Default expiry time is 5 minutes = 300 seconds
|
||||
require 'uservoice-ruby'
|
||||
|
||||
def current_sso_token
|
||||
@current_sso_token ||= UserVoice.generate_sso_token('metamapscc', ENV['SSO_KEY'], {
|
||||
:email => current_user.email
|
||||
}, 300) # Default expiry time is 5 minutes = 300 seconds
|
||||
end
|
|
@ -1,18 +1,18 @@
|
|||
## Node.js realtime server
|
||||
|
||||
To run the server, you need to install the dependencies and run the server.
|
||||
Please ensure you have followed the OS-specific instructions in doc/ to
|
||||
install NodeJS. Once you have node, then you can proceed to install the
|
||||
node packages for the realtime server:
|
||||
|
||||
cd realtime
|
||||
npm install #creates node_modules directory
|
||||
node realtime-server.js
|
||||
|
||||
That's it!
|
||||
|
||||
To run the server as a daemon that will be re-run if it crashes, you can
|
||||
use the forever node package.
|
||||
|
||||
sudo npm install -g forever
|
||||
forever start realtime-server.js
|
||||
## Node.js realtime server
|
||||
|
||||
To run the server, you need to install the dependencies and run the server.
|
||||
Please ensure you have followed the OS-specific instructions in doc/ to
|
||||
install NodeJS. Once you have node, then you can proceed to install the
|
||||
node packages for the realtime server:
|
||||
|
||||
cd realtime
|
||||
npm install #creates node_modules directory
|
||||
node realtime-server.js
|
||||
|
||||
That's it!
|
||||
|
||||
To run the server as a daemon that will be re-run if it crashes, you can
|
||||
use the forever node package.
|
||||
|
||||
sudo npm install -g forever
|
||||
forever start realtime-server.js
|
||||
|
|
Loading…
Reference in a new issue