diff --git a/app/assets/javascripts/gallery/.keep b/app/assets/images/gallery/.gitkeep similarity index 100% rename from app/assets/javascripts/gallery/.keep rename to app/assets/images/gallery/.gitkeep diff --git a/app/assets/images/gallery/default.jpg b/app/assets/images/gallery/default.jpg new file mode 100755 index 0000000..3a48d48 Binary files /dev/null and b/app/assets/images/gallery/default.jpg differ diff --git a/app/assets/images/gallery/nodata.jpg b/app/assets/images/gallery/nodata.jpg new file mode 100755 index 0000000..d3c857b Binary files /dev/null and b/app/assets/images/gallery/nodata.jpg differ diff --git a/app/assets/images/gallery/pbar-ani.gif b/app/assets/images/gallery/pbar-ani.gif new file mode 100755 index 0000000..6edd174 Binary files /dev/null and b/app/assets/images/gallery/pbar-ani.gif differ diff --git a/app/assets/images/gallery/slidelistbg.png b/app/assets/images/gallery/slidelistbg.png new file mode 100755 index 0000000..8d468d0 Binary files /dev/null and b/app/assets/images/gallery/slidelistbg.png differ diff --git a/app/assets/images/gallery/slidenav.png b/app/assets/images/gallery/slidenav.png new file mode 100755 index 0000000..79fd32e Binary files /dev/null and b/app/assets/images/gallery/slidenav.png differ diff --git a/app/assets/images/gallery/slidetitlebg.png b/app/assets/images/gallery/slidetitlebg.png new file mode 100755 index 0000000..f6de34e Binary files /dev/null and b/app/assets/images/gallery/slidetitlebg.png differ diff --git a/app/assets/images/gallery/slideui.gif b/app/assets/images/gallery/slideui.gif new file mode 100755 index 0000000..8d16d90 Binary files /dev/null and b/app/assets/images/gallery/slideui.gif differ diff --git a/app/assets/images/gallery/upicon.png b/app/assets/images/gallery/upicon.png new file mode 100755 index 0000000..0a16ebe Binary files /dev/null and b/app/assets/images/gallery/upicon.png differ diff --git a/app/assets/images/gallery/uploadbg.gif b/app/assets/images/gallery/uploadbg.gif new file mode 100755 index 0000000..e5fac42 Binary files /dev/null and b/app/assets/images/gallery/uploadbg.gif differ diff --git a/app/assets/images/gallery/uppt.png b/app/assets/images/gallery/uppt.png new file mode 100755 index 0000000..b1c0db0 Binary files /dev/null and b/app/assets/images/gallery/uppt.png differ diff --git a/app/assets/images/gallery/upsep.png b/app/assets/images/gallery/upsep.png new file mode 100755 index 0000000..314f8ac Binary files /dev/null and b/app/assets/images/gallery/upsep.png differ diff --git a/app/assets/javascripts/admin/galleries.js b/app/assets/javascripts/admin/galleries.js deleted file mode 100644 index dee720f..0000000 --- a/app/assets/javascripts/admin/galleries.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/cycle.js b/app/assets/javascripts/cycle.js new file mode 100755 index 0000000..cd60730 --- /dev/null +++ b/app/assets/javascripts/cycle.js @@ -0,0 +1,1551 @@ +/*! + * jQuery Cycle Plugin (with Transition Definitions) + * Examples and documentation at: http://jquery.malsup.com/cycle/ + * Copyright (c) 2007-2010 M. Alsup + * Version: 2.9999.8 (26-OCT-2012) + * Dual licensed under the MIT and GPL licenses. + * http://jquery.malsup.com/license.html + * Requires: jQuery v1.3.2 or later + */ +;(function($, undefined) { +"use strict"; + +var ver = '2.9999.8'; + +// if $.support is not defined (pre jQuery 1.3) add what I need +if ($.support === undefined) { + $.support = { + opacity: !($.browser.msie) + }; +} + +function debug(s) { + if ($.fn.cycle.debug) + log(s); +} +function log() { + if (window.console && console.log) + console.log('[cycle] ' + Array.prototype.join.call(arguments,' ')); +} +$.expr[':'].paused = function(el) { + return el.cyclePause; +}; + + +// the options arg can be... +// a number - indicates an immediate transition should occur to the given slide index +// a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc) +// an object - properties to control the slideshow +// +// the arg2 arg can be... +// the name of an fx (only used in conjunction with a numeric value for 'options') +// the value true (only used in first arg == 'resume') and indicates +// that the resume should occur immediately (not wait for next timeout) + +$.fn.cycle = function(options, arg2) { + var o = { s: this.selector, c: this.context }; + + // in 1.3+ we can fix mistakes with the ready state + if (this.length === 0 && options != 'stop') { + if (!$.isReady && o.s) { + log('DOM not ready, queuing slideshow'); + $(function() { + $(o.s,o.c).cycle(options,arg2); + }); + return this; + } + // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() + log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); + return this; + } + + // iterate the matched nodeset + return this.each(function() { + var opts = handleArguments(this, options, arg2); + if (opts === false) + return; + + opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; + + // stop existing slideshow for this container (if there is one) + if (this.cycleTimeout) + clearTimeout(this.cycleTimeout); + this.cycleTimeout = this.cyclePause = 0; + this.cycleStop = 0; // issue #108 + + var $cont = $(this); + var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children(); + var els = $slides.get(); + + if (els.length < 2) { + log('terminating; too few slides: ' + els.length); + return; + } + + var opts2 = buildOptions($cont, $slides, els, opts, o); + if (opts2 === false) + return; + + var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards); + + // if it's an auto slideshow, kick it off + if (startTime) { + startTime += (opts2.delay || 0); + if (startTime < 10) + startTime = 10; + debug('first timeout: ' + startTime); + this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime); + } + }); +}; + +function triggerPause(cont, byHover, onPager) { + var opts = $(cont).data('cycle.opts'); + if (!opts) + return; + var paused = !!cont.cyclePause; + if (paused && opts.paused) + opts.paused(cont, opts, byHover, onPager); + else if (!paused && opts.resumed) + opts.resumed(cont, opts, byHover, onPager); +} + +// process the args that were passed to the plugin fn +function handleArguments(cont, options, arg2) { + if (cont.cycleStop === undefined) + cont.cycleStop = 0; + if (options === undefined || options === null) + options = {}; + if (options.constructor == String) { + switch(options) { + case 'destroy': + case 'stop': + var opts = $(cont).data('cycle.opts'); + if (!opts) + return false; + cont.cycleStop++; // callbacks look for change + if (cont.cycleTimeout) + clearTimeout(cont.cycleTimeout); + cont.cycleTimeout = 0; + if (opts.elements) + $(opts.elements).stop(); + $(cont).removeData('cycle.opts'); + if (options == 'destroy') + destroy(cont, opts); + return false; + case 'toggle': + cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1; + checkInstantResume(cont.cyclePause, arg2, cont); + triggerPause(cont); + return false; + case 'pause': + cont.cyclePause = 1; + triggerPause(cont); + return false; + case 'resume': + cont.cyclePause = 0; + checkInstantResume(false, arg2, cont); + triggerPause(cont); + return false; + case 'prev': + case 'next': + opts = $(cont).data('cycle.opts'); + if (!opts) { + log('options not found, "prev/next" ignored'); + return false; + } + $.fn.cycle[options](opts); + return false; + default: + options = { fx: options }; + } + return options; + } + else if (options.constructor == Number) { + // go to the requested slide + var num = options; + options = $(cont).data('cycle.opts'); + if (!options) { + log('options not found, can not advance slide'); + return false; + } + if (num < 0 || num >= options.elements.length) { + log('invalid slide index: ' + num); + return false; + } + options.nextSlide = num; + if (cont.cycleTimeout) { + clearTimeout(cont.cycleTimeout); + cont.cycleTimeout = 0; + } + if (typeof arg2 == 'string') + options.oneTimeFx = arg2; + go(options.elements, options, 1, num >= options.currSlide); + return false; + } + return options; + + function checkInstantResume(isPaused, arg2, cont) { + if (!isPaused && arg2 === true) { // resume now! + var options = $(cont).data('cycle.opts'); + if (!options) { + log('options not found, can not resume'); + return false; + } + if (cont.cycleTimeout) { + clearTimeout(cont.cycleTimeout); + cont.cycleTimeout = 0; + } + go(options.elements, options, 1, !options.backwards); + } + } +} + +function removeFilter(el, opts) { + if (!$.support.opacity && opts.cleartype && el.style.filter) { + try { el.style.removeAttribute('filter'); } + catch(smother) {} // handle old opera versions + } +} + +// unbind event handlers +function destroy(cont, opts) { + if (opts.next) + $(opts.next).unbind(opts.prevNextEvent); + if (opts.prev) + $(opts.prev).unbind(opts.prevNextEvent); + + if (opts.pager || opts.pagerAnchorBuilder) + $.each(opts.pagerAnchors || [], function() { + this.unbind().remove(); + }); + opts.pagerAnchors = null; + $(cont).unbind('mouseenter.cycle mouseleave.cycle'); + if (opts.destroy) // callback + opts.destroy(opts); +} + +// one-time initialization +function buildOptions($cont, $slides, els, options, o) { + var startingSlideSpecified; + // support metadata plugin (v1.0 and v2.0) + var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); + var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null; + if (meta) + opts = $.extend(opts, meta); + if (opts.autostop) + opts.countdown = opts.autostopCount || els.length; + + var cont = $cont[0]; + $cont.data('cycle.opts', opts); + opts.$cont = $cont; + opts.stopCount = cont.cycleStop; + opts.elements = els; + opts.before = opts.before ? [opts.before] : []; + opts.after = opts.after ? [opts.after] : []; + + // push some after callbacks + if (!$.support.opacity && opts.cleartype) + opts.after.push(function() { removeFilter(this, opts); }); + if (opts.continuous) + opts.after.push(function() { go(els,opts,0,!opts.backwards); }); + + saveOriginalOpts(opts); + + // clearType corrections + if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) + clearTypeFix($slides); + + // container requires non-static position so that slides can be position within + if ($cont.css('position') == 'static') + $cont.css('position', 'relative'); + if (opts.width) + $cont.width(opts.width); + if (opts.height && opts.height != 'auto') + $cont.height(opts.height); + + if (opts.startingSlide !== undefined) { + opts.startingSlide = parseInt(opts.startingSlide,10); + if (opts.startingSlide >= els.length || opts.startSlide < 0) + opts.startingSlide = 0; // catch bogus input + else + startingSlideSpecified = true; + } + else if (opts.backwards) + opts.startingSlide = els.length - 1; + else + opts.startingSlide = 0; + + // if random, mix up the slide array + if (opts.random) { + opts.randomMap = []; + for (var i = 0; i < els.length; i++) + opts.randomMap.push(i); + opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); + if (startingSlideSpecified) { + // try to find the specified starting slide and if found set start slide index in the map accordingly + for ( var cnt = 0; cnt < els.length; cnt++ ) { + if ( opts.startingSlide == opts.randomMap[cnt] ) { + opts.randomIndex = cnt; + } + } + } + else { + opts.randomIndex = 1; + opts.startingSlide = opts.randomMap[1]; + } + } + else if (opts.startingSlide >= els.length) + opts.startingSlide = 0; // catch bogus input + opts.currSlide = opts.startingSlide || 0; + var first = opts.startingSlide; + + // set position and zIndex on all the slides + $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { + var z; + if (opts.backwards) + z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i; + else + z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; + $(this).css('z-index', z); + }); + + // make sure first slide is visible + $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case + removeFilter(els[first], opts); + + // stretch slides + if (opts.fit) { + if (!opts.aspect) { + if (opts.width) + $slides.width(opts.width); + if (opts.height && opts.height != 'auto') + $slides.height(opts.height); + } else { + $slides.each(function(){ + var $slide = $(this); + var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect; + if( opts.width && $slide.width() != opts.width ) { + $slide.width( opts.width ); + $slide.height( opts.width / ratio ); + } + + if( opts.height && $slide.height() < opts.height ) { + $slide.height( opts.height ); + $slide.width( opts.height * ratio ); + } + }); + } + } + + if (opts.center && ((!opts.fit) || opts.aspect)) { + $slides.each(function(){ + var $slide = $(this); + $slide.css({ + "margin-left": opts.width ? + ((opts.width - $slide.width()) / 2) + "px" : + 0, + "margin-top": opts.height ? + ((opts.height - $slide.height()) / 2) + "px" : + 0 + }); + }); + } + + if (opts.center && !opts.fit && !opts.slideResize) { + $slides.each(function(){ + var $slide = $(this); + $slide.css({ + "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0, + "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0 + }); + }); + } + + // stretch container + var reshape = (opts.containerResize || opts.containerResizeHeight) && !$cont.innerHeight(); + if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9 + var maxw = 0, maxh = 0; + for(var j=0; j < els.length; j++) { + var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); + if (!w) w = e.offsetWidth || e.width || $e.attr('width'); + if (!h) h = e.offsetHeight || e.height || $e.attr('height'); + maxw = w > maxw ? w : maxw; + maxh = h > maxh ? h : maxh; + } + if (opts.containerResize && maxw > 0 && maxh > 0) + $cont.css({width:maxw+'px',height:maxh+'px'}); + if (opts.containerResizeHeight && maxh > 0) + $cont.css({height:maxh+'px'}); + } + + var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 + if (opts.pause) + $cont.bind('mouseenter.cycle', function(){ + pauseFlag = true; + this.cyclePause++; + triggerPause(cont, true); + }).bind('mouseleave.cycle', function(){ + if (pauseFlag) + this.cyclePause--; + triggerPause(cont, true); + }); + + if (supportMultiTransitions(opts) === false) + return false; + + // apparently a lot of people use image slideshows without height/width attributes on the images. + // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that. + var requeue = false; + options.requeueAttempts = options.requeueAttempts || 0; + $slides.each(function() { + // try to get height/width of each slide + var $el = $(this); + this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0); + this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0); + + if ( $el.is('img') ) { + // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when + // an image is being downloaded and the markup did not include sizing info (height/width attributes); + // there seems to be some "default" sizes used in this situation + var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); + var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete); + var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete); + var loadingOther = (this.cycleH === 0 && this.cycleW === 0 && !this.complete); + // don't requeue for images that are still loading but have a valid size + if (loadingIE || loadingFF || loadingOp || loadingOther) { + if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever + log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH); + setTimeout(function() {$(o.s,o.c).cycle(options);}, opts.requeueTimeout); + requeue = true; + return false; // break each loop + } + else { + log('could not determine size of image: '+this.src, this.cycleW, this.cycleH); + } + } + } + return true; + }); + + if (requeue) + return false; + + opts.cssBefore = opts.cssBefore || {}; + opts.cssAfter = opts.cssAfter || {}; + opts.cssFirst = opts.cssFirst || {}; + opts.animIn = opts.animIn || {}; + opts.animOut = opts.animOut || {}; + + $slides.not(':eq('+first+')').css(opts.cssBefore); + $($slides[first]).css(opts.cssFirst); + + if (opts.timeout) { + opts.timeout = parseInt(opts.timeout,10); + // ensure that timeout and speed settings are sane + if (opts.speed.constructor == String) + opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10); + if (!opts.sync) + opts.speed = opts.speed / 2; + + var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250; + while((opts.timeout - opts.speed) < buffer) // sanitize timeout + opts.timeout += opts.speed; + } + if (opts.easing) + opts.easeIn = opts.easeOut = opts.easing; + if (!opts.speedIn) + opts.speedIn = opts.speed; + if (!opts.speedOut) + opts.speedOut = opts.speed; + + opts.slideCount = els.length; + opts.currSlide = opts.lastSlide = first; + if (opts.random) { + if (++opts.randomIndex == els.length) + opts.randomIndex = 0; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else if (opts.backwards) + opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1; + else + opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; + + // run transition init fn + if (!opts.multiFx) { + var init = $.fn.cycle.transitions[opts.fx]; + if ($.isFunction(init)) + init($cont, $slides, opts); + else if (opts.fx != 'custom' && !opts.multiFx) { + log('unknown transition: ' + opts.fx,'; slideshow terminating'); + return false; + } + } + + // fire artificial events + var e0 = $slides[first]; + if (!opts.skipInitializationCallbacks) { + if (opts.before.length) + opts.before[0].apply(e0, [e0, e0, opts, true]); + if (opts.after.length) + opts.after[0].apply(e0, [e0, e0, opts, true]); + } + if (opts.next) + $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);}); + if (opts.prev) + $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);}); + if (opts.pager || opts.pagerAnchorBuilder) + buildPager(els,opts); + + exposeAddSlide(opts, els); + + return opts; +} + +// save off original opts so we can restore after clearing state +function saveOriginalOpts(opts) { + opts.original = { before: [], after: [] }; + opts.original.cssBefore = $.extend({}, opts.cssBefore); + opts.original.cssAfter = $.extend({}, opts.cssAfter); + opts.original.animIn = $.extend({}, opts.animIn); + opts.original.animOut = $.extend({}, opts.animOut); + $.each(opts.before, function() { opts.original.before.push(this); }); + $.each(opts.after, function() { opts.original.after.push(this); }); +} + +function supportMultiTransitions(opts) { + var i, tx, txs = $.fn.cycle.transitions; + // look for multiple effects + if (opts.fx.indexOf(',') > 0) { + opts.multiFx = true; + opts.fxs = opts.fx.replace(/\s*/g,'').split(','); + // discard any bogus effect names + for (i=0; i < opts.fxs.length; i++) { + var fx = opts.fxs[i]; + tx = txs[fx]; + if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { + log('discarding unknown transition: ',fx); + opts.fxs.splice(i,1); + i--; + } + } + // if we have an empty list then we threw everything away! + if (!opts.fxs.length) { + log('No valid transitions named; slideshow terminating.'); + return false; + } + } + else if (opts.fx == 'all') { // auto-gen the list of transitions + opts.multiFx = true; + opts.fxs = []; + for (var p in txs) { + if (txs.hasOwnProperty(p)) { + tx = txs[p]; + if (txs.hasOwnProperty(p) && $.isFunction(tx)) + opts.fxs.push(p); + } + } + } + if (opts.multiFx && opts.randomizeEffects) { + // munge the fxs array to make effect selection random + var r1 = Math.floor(Math.random() * 20) + 30; + for (i = 0; i < r1; i++) { + var r2 = Math.floor(Math.random() * opts.fxs.length); + opts.fxs.push(opts.fxs.splice(r2,1)[0]); + } + debug('randomized fx sequence: ',opts.fxs); + } + return true; +} + +// provide a mechanism for adding slides after the slideshow has started +function exposeAddSlide(opts, els) { + opts.addSlide = function(newSlide, prepend) { + var $s = $(newSlide), s = $s[0]; + if (!opts.autostopCount) + opts.countdown++; + els[prepend?'unshift':'push'](s); + if (opts.els) + opts.els[prepend?'unshift':'push'](s); // shuffle needs this + opts.slideCount = els.length; + + // add the slide to the random map and resort + if (opts.random) { + opts.randomMap.push(opts.slideCount-1); + opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); + } + + $s.css('position','absolute'); + $s[prepend?'prependTo':'appendTo'](opts.$cont); + + if (prepend) { + opts.currSlide++; + opts.nextSlide++; + } + + if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) + clearTypeFix($s); + + if (opts.fit && opts.width) + $s.width(opts.width); + if (opts.fit && opts.height && opts.height != 'auto') + $s.height(opts.height); + s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); + s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); + + $s.css(opts.cssBefore); + + if (opts.pager || opts.pagerAnchorBuilder) + $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); + + if ($.isFunction(opts.onAddSlide)) + opts.onAddSlide($s); + else + $s.hide(); // default behavior + }; +} + +// reset internal state; we do this on every pass in order to support multiple effects +$.fn.cycle.resetState = function(opts, fx) { + fx = fx || opts.fx; + opts.before = []; opts.after = []; + opts.cssBefore = $.extend({}, opts.original.cssBefore); + opts.cssAfter = $.extend({}, opts.original.cssAfter); + opts.animIn = $.extend({}, opts.original.animIn); + opts.animOut = $.extend({}, opts.original.animOut); + opts.fxFn = null; + $.each(opts.original.before, function() { opts.before.push(this); }); + $.each(opts.original.after, function() { opts.after.push(this); }); + + // re-init + var init = $.fn.cycle.transitions[fx]; + if ($.isFunction(init)) + init(opts.$cont, $(opts.elements), opts); +}; + +// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt +function go(els, opts, manual, fwd) { + var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; + + // opts.busy is true if we're in the middle of an animation + if (manual && opts.busy && opts.manualTrump) { + // let manual transitions requests trump active ones + debug('manualTrump in go(), stopping active transition'); + $(els).stop(true,true); + opts.busy = 0; + clearTimeout(p.cycleTimeout); + } + + // don't begin another timeout-based transition if there is one active + if (opts.busy) { + debug('transition active, ignoring new tx request'); + return; + } + + + // stop cycling if we have an outstanding stop request + if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) + return; + + // check to see if we should stop cycling based on autostop options + if (!manual && !p.cyclePause && !opts.bounce && + ((opts.autostop && (--opts.countdown <= 0)) || + (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { + if (opts.end) + opts.end(opts); + return; + } + + // if slideshow is paused, only transition on a manual trigger + var changed = false; + if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) { + changed = true; + var fx = opts.fx; + // keep trying to get the slide size if we don't have it yet + curr.cycleH = curr.cycleH || $(curr).height(); + curr.cycleW = curr.cycleW || $(curr).width(); + next.cycleH = next.cycleH || $(next).height(); + next.cycleW = next.cycleW || $(next).width(); + + // support multiple transition types + if (opts.multiFx) { + if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length)) + opts.lastFx = 0; + else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0)) + opts.lastFx = opts.fxs.length - 1; + fx = opts.fxs[opts.lastFx]; + } + + // one-time fx overrides apply to: $('div').cycle(3,'zoom'); + if (opts.oneTimeFx) { + fx = opts.oneTimeFx; + opts.oneTimeFx = null; + } + + $.fn.cycle.resetState(opts, fx); + + // run the before callbacks + if (opts.before.length) + $.each(opts.before, function(i,o) { + if (p.cycleStop != opts.stopCount) return; + o.apply(next, [curr, next, opts, fwd]); + }); + + // stage the after callacks + var after = function() { + opts.busy = 0; + $.each(opts.after, function(i,o) { + if (p.cycleStop != opts.stopCount) return; + o.apply(next, [curr, next, opts, fwd]); + }); + if (!p.cycleStop) { + // queue next transition + queueNext(); + } + }; + + debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide); + + // get ready to perform the transition + opts.busy = 1; + if (opts.fxFn) // fx function provided? + opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent); + else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ? + $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent); + else + $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent); + } + else { + queueNext(); + } + + if (changed || opts.nextSlide == opts.currSlide) { + // calculate the next slide + var roll; + opts.lastSlide = opts.currSlide; + if (opts.random) { + opts.currSlide = opts.nextSlide; + if (++opts.randomIndex == els.length) { + opts.randomIndex = 0; + opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); + } + opts.nextSlide = opts.randomMap[opts.randomIndex]; + if (opts.nextSlide == opts.currSlide) + opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1; + } + else if (opts.backwards) { + roll = (opts.nextSlide - 1) < 0; + if (roll && opts.bounce) { + opts.backwards = !opts.backwards; + opts.nextSlide = 1; + opts.currSlide = 0; + } + else { + opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1; + opts.currSlide = roll ? 0 : opts.nextSlide+1; + } + } + else { // sequence + roll = (opts.nextSlide + 1) == els.length; + if (roll && opts.bounce) { + opts.backwards = !opts.backwards; + opts.nextSlide = els.length-2; + opts.currSlide = els.length-1; + } + else { + opts.nextSlide = roll ? 0 : opts.nextSlide+1; + opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; + } + } + } + if (changed && opts.pager) + opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); + + function queueNext() { + // stage the next transition + var ms = 0, timeout = opts.timeout; + if (opts.timeout && !opts.continuous) { + ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd); + if (opts.fx == 'shuffle') + ms -= opts.speedOut; + } + else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic + ms = 10; + if (ms > 0) + p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms); + } +} + +// invoked after transition +$.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) { + $(pager).each(function() { + $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName); + }); +}; + +// calculate timeout value for current transition +function getTimeout(curr, next, opts, fwd) { + if (opts.timeoutFn) { + // call user provided calc fn + var t = opts.timeoutFn.call(curr,curr,next,opts,fwd); + while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout + t += opts.speed; + debug('calculated timeout: ' + t + '; speed: ' + opts.speed); + if (t !== false) + return t; + } + return opts.timeout; +} + +// expose next/prev function, caller must pass in state +$.fn.cycle.next = function(opts) { advance(opts,1); }; +$.fn.cycle.prev = function(opts) { advance(opts,0);}; + +// advance slide forward or back +function advance(opts, moveForward) { + var val = moveForward ? 1 : -1; + var els = opts.elements; + var p = opts.$cont[0], timeout = p.cycleTimeout; + if (timeout) { + clearTimeout(timeout); + p.cycleTimeout = 0; + } + if (opts.random && val < 0) { + // move back to the previously display slide + opts.randomIndex--; + if (--opts.randomIndex == -2) + opts.randomIndex = els.length-2; + else if (opts.randomIndex == -1) + opts.randomIndex = els.length-1; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else if (opts.random) { + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else { + opts.nextSlide = opts.currSlide + val; + if (opts.nextSlide < 0) { + if (opts.nowrap) return false; + opts.nextSlide = els.length - 1; + } + else if (opts.nextSlide >= els.length) { + if (opts.nowrap) return false; + opts.nextSlide = 0; + } + } + + var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated + if ($.isFunction(cb)) + cb(val > 0, opts.nextSlide, els[opts.nextSlide]); + go(els, opts, 1, moveForward); + return false; +} + +function buildPager(els, opts) { + var $p = $(opts.pager); + $.each(els, function(i,o) { + $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); + }); + opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass); +} + +$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { + var a; + if ($.isFunction(opts.pagerAnchorBuilder)) { + a = opts.pagerAnchorBuilder(i,el); + debug('pagerAnchorBuilder('+i+', el) returned: ' + a); + } + else + a = ''+(i+1)+''; + + if (!a) + return; + var $a = $(a); + // don't reparent if anchor is in the dom + if ($a.parents('body').length === 0) { + var arr = []; + if ($p.length > 1) { + $p.each(function() { + var $clone = $a.clone(true); + $(this).append($clone); + arr.push($clone[0]); + }); + $a = $(arr); + } + else { + $a.appendTo($p); + } + } + + opts.pagerAnchors = opts.pagerAnchors || []; + opts.pagerAnchors.push($a); + + var pagerFn = function(e) { + e.preventDefault(); + opts.nextSlide = i; + var p = opts.$cont[0], timeout = p.cycleTimeout; + if (timeout) { + clearTimeout(timeout); + p.cycleTimeout = 0; + } + var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated + if ($.isFunction(cb)) + cb(opts.nextSlide, els[opts.nextSlide]); + go(els,opts,1,opts.currSlide < i); // trigger the trans +// return false; // <== allow bubble + }; + + if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) { + $a.hover(pagerFn, function(){/* no-op */} ); + } + else { + $a.bind(opts.pagerEvent, pagerFn); + } + + if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) + $a.bind('click.cycle', function(){return false;}); // suppress click + + var cont = opts.$cont[0]; + var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 + if (opts.pauseOnPagerHover) { + $a.hover( + function() { + pauseFlag = true; + cont.cyclePause++; + triggerPause(cont,true,true); + }, function() { + if (pauseFlag) + cont.cyclePause--; + triggerPause(cont,true,true); + } + ); + } +}; + +// helper fn to calculate the number of slides between the current and the next +$.fn.cycle.hopsFromLast = function(opts, fwd) { + var hops, l = opts.lastSlide, c = opts.currSlide; + if (fwd) + hops = c > l ? c - l : opts.slideCount - l; + else + hops = c < l ? l - c : l + opts.slideCount - c; + return hops; +}; + +// fix clearType problems in ie6 by setting an explicit bg color +// (otherwise text slides look horrible during a fade transition) +function clearTypeFix($slides) { + debug('applying clearType background-color hack'); + function hex(s) { + s = parseInt(s,10).toString(16); + return s.length < 2 ? '0'+s : s; + } + function getBg(e) { + for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { + var v = $.css(e,'background-color'); + if (v && v.indexOf('rgb') >= 0 ) { + var rgb = v.match(/\d+/g); + return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); + } + if (v && v != 'transparent') + return v; + } + return '#ffffff'; + } + $slides.each(function() { $(this).css('background-color', getBg(this)); }); +} + +// reset common props before the next transition +$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) { + $(opts.elements).not(curr).hide(); + if (typeof opts.cssBefore.opacity == 'undefined') + opts.cssBefore.opacity = 1; + opts.cssBefore.display = 'block'; + if (opts.slideResize && w !== false && next.cycleW > 0) + opts.cssBefore.width = next.cycleW; + if (opts.slideResize && h !== false && next.cycleH > 0) + opts.cssBefore.height = next.cycleH; + opts.cssAfter = opts.cssAfter || {}; + opts.cssAfter.display = 'none'; + $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0)); + $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1)); +}; + +// the actual fn for effecting a transition +$.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) { + var $l = $(curr), $n = $(next); + var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; + $n.css(opts.cssBefore); + if (speedOverride) { + if (typeof speedOverride == 'number') + speedIn = speedOut = speedOverride; + else + speedIn = speedOut = 1; + easeIn = easeOut = null; + } + var fn = function() { + $n.animate(opts.animIn, speedIn, easeIn, function() { + cb(); + }); + }; + $l.animate(opts.animOut, speedOut, easeOut, function() { + $l.css(opts.cssAfter); + if (!opts.sync) + fn(); + }); + if (opts.sync) fn(); +}; + +// transition definitions - only fade is defined here, transition pack defines the rest +$.fn.cycle.transitions = { + fade: function($cont, $slides, opts) { + $slides.not(':eq('+opts.currSlide+')').css('opacity',0); + opts.before.push(function(curr,next,opts) { + $.fn.cycle.commonReset(curr,next,opts); + opts.cssBefore.opacity = 0; + }); + opts.animIn = { opacity: 1 }; + opts.animOut = { opacity: 0 }; + opts.cssBefore = { top: 0, left: 0 }; + } +}; + +$.fn.cycle.ver = function() { return ver; }; + +// override these globally if you like (they are all optional) +$.fn.cycle.defaults = { + activePagerClass: 'activeSlide', // class name used for the active pager link + after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) + allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling + animIn: null, // properties that define how the slide animates in + animOut: null, // properties that define how the slide animates out + aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option) + autostop: 0, // true to end slideshow after X transitions (where X == slide count) + autostopCount: 0, // number of transitions (optionally used with autostop to define X) + backwards: false, // true to start slideshow at last slide and move backwards through the stack + before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) + center: null, // set to true to have cycle add top/left margin to each slide (use with width and height options) + cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE) + cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) + containerResize: 1, // resize container to fit largest slide + containerResizeHeight: 0, // resize containers height to fit the largest slide but leave the width dynamic + continuous: 0, // true to start next transition immediately after current one completes + cssAfter: null, // properties that defined the state of the slide after transitioning out + cssBefore: null, // properties that define the initial state of the slide before transitioning in + delay: 0, // additional delay (in ms) for first transition (hint: can be negative) + easeIn: null, // easing for "in" transition + easeOut: null, // easing for "out" transition + easing: null, // easing method for both in and out transitions + end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) + fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms + fit: 0, // force slides to fit container + fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle') + fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) + height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well) + manualTrump: true, // causes manual transition to stop an active transition instead of being ignored + metaAttr: 'cycle', // data- attribute that holds the option data for the slideshow + next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide + nowrap: 0, // true to prevent slideshow from wrapping + onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement) + onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement) + pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container + pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement) + pagerEvent: 'click.cycle', // name of event which drives the pager navigation + pause: 0, // true to enable "pause on hover" + pauseOnPagerHover: 0, // true to pause when hovering over pager link + prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide + prevNextEvent: 'click.cycle',// event which drives the manual transition to the previous or next slide + random: 0, // true for random, false for sequence (not applicable to shuffle fx) + randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random + requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded + requeueTimeout: 250, // ms delay for requeue + rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle) + shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } + skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition + slideExpr: null, // expression for selecting slides (if something other than all children is required) + slideResize: 1, // force slide width/height to fixed size before every transition + speed: 1000, // speed of the transition (any valid fx speed value) + speedIn: null, // speed of the 'in' transition + speedOut: null, // speed of the 'out' transition + startingSlide: undefined,// zero-based index of the first slide to be displayed + sync: 1, // true if in/out transitions should occur simultaneously + timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) + timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag) + updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style) + width: null // container width (if the 'fit' option is true, the slides will be set to this width as well) +}; + +})(jQuery); + + +/*! + * jQuery Cycle Plugin Transition Definitions + * This script is a plugin for the jQuery Cycle Plugin + * Examples and documentation at: http://malsup.com/jquery/cycle/ + * Copyright (c) 2007-2010 M. Alsup + * Version: 2.73 + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($) { +"use strict"; + +// +// These functions define slide initialization and properties for the named +// transitions. To save file size feel free to remove any of these that you +// don't need. +// +$.fn.cycle.transitions.none = function($cont, $slides, opts) { + opts.fxFn = function(curr,next,opts,after){ + $(next).show(); + $(curr).hide(); + after(); + }; +}; + +// not a cross-fade, fadeout only fades out the top slide +$.fn.cycle.transitions.fadeout = function($cont, $slides, opts) { + $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 }); + opts.before.push(function(curr,next,opts,w,h,rev) { + $(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0)); + $(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1)); + }); + opts.animIn.opacity = 1; + opts.animOut.opacity = 0; + opts.cssBefore.opacity = 1; + opts.cssBefore.display = 'block'; + opts.cssAfter.zIndex = 0; +}; + +// scrollUp/Down/Left/Right +$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push($.fn.cycle.commonReset); + var h = $cont.height(); + opts.cssBefore.top = h; + opts.cssBefore.left = 0; + opts.cssFirst.top = 0; + opts.animIn.top = 0; + opts.animOut.top = -h; +}; +$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push($.fn.cycle.commonReset); + var h = $cont.height(); + opts.cssFirst.top = 0; + opts.cssBefore.top = -h; + opts.cssBefore.left = 0; + opts.animIn.top = 0; + opts.animOut.top = h; +}; +$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push($.fn.cycle.commonReset); + var w = $cont.width(); + opts.cssFirst.left = 0; + opts.cssBefore.left = w; + opts.cssBefore.top = 0; + opts.animIn.left = 0; + opts.animOut.left = 0-w; +}; +$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push($.fn.cycle.commonReset); + var w = $cont.width(); + opts.cssFirst.left = 0; + opts.cssBefore.left = -w; + opts.cssBefore.top = 0; + opts.animIn.left = 0; + opts.animOut.left = w; +}; +$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { + $cont.css('overflow','hidden').width(); + opts.before.push(function(curr, next, opts, fwd) { + if (opts.rev) + fwd = !fwd; + $.fn.cycle.commonReset(curr,next,opts); + opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW); + opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW; + }); + opts.cssFirst.left = 0; + opts.cssBefore.top = 0; + opts.animIn.left = 0; + opts.animOut.top = 0; +}; +$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push(function(curr, next, opts, fwd) { + if (opts.rev) + fwd = !fwd; + $.fn.cycle.commonReset(curr,next,opts); + opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1); + opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH; + }); + opts.cssFirst.top = 0; + opts.cssBefore.left = 0; + opts.animIn.top = 0; + opts.animOut.left = 0; +}; + +// slideX/slideY +$.fn.cycle.transitions.slideX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(opts.elements).not(curr).hide(); + $.fn.cycle.commonReset(curr,next,opts,false,true); + opts.animIn.width = next.cycleW; + }); + opts.cssBefore.left = 0; + opts.cssBefore.top = 0; + opts.cssBefore.width = 0; + opts.animIn.width = 'show'; + opts.animOut.width = 0; +}; +$.fn.cycle.transitions.slideY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(opts.elements).not(curr).hide(); + $.fn.cycle.commonReset(curr,next,opts,true,false); + opts.animIn.height = next.cycleH; + }); + opts.cssBefore.left = 0; + opts.cssBefore.top = 0; + opts.cssBefore.height = 0; + opts.animIn.height = 'show'; + opts.animOut.height = 0; +}; + +// shuffle +$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { + var i, w = $cont.css('overflow', 'visible').width(); + $slides.css({left: 0, top: 0}); + opts.before.push(function(curr,next,opts) { + $.fn.cycle.commonReset(curr,next,opts,true,true,true); + }); + // only adjust speed once! + if (!opts.speedAdjusted) { + opts.speed = opts.speed / 2; // shuffle has 2 transitions + opts.speedAdjusted = true; + } + opts.random = 0; + opts.shuffle = opts.shuffle || {left:-w, top:15}; + opts.els = []; + for (i=0; i < $slides.length; i++) + opts.els.push($slides[i]); + + for (i=0; i < opts.currSlide; i++) + opts.els.push(opts.els.shift()); + + // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) + opts.fxFn = function(curr, next, opts, cb, fwd) { + if (opts.rev) + fwd = !fwd; + var $el = fwd ? $(curr) : $(next); + $(next).css(opts.cssBefore); + var count = opts.slideCount; + $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { + var hops = $.fn.cycle.hopsFromLast(opts, fwd); + for (var k=0; k < hops; k++) { + if (fwd) + opts.els.push(opts.els.shift()); + else + opts.els.unshift(opts.els.pop()); + } + if (fwd) { + for (var i=0, len=opts.els.length; i < len; i++) + $(opts.els[i]).css('z-index', len-i+count); + } + else { + var z = $(curr).css('z-index'); + $el.css('z-index', parseInt(z,10)+1+count); + } + $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() { + $(fwd ? this : curr).hide(); + if (cb) cb(); + }); + }); + }; + $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); +}; + +// turnUp/Down/Left/Right +$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,false); + opts.cssBefore.top = next.cycleH; + opts.animIn.height = next.cycleH; + opts.animOut.width = next.cycleW; + }); + opts.cssFirst.top = 0; + opts.cssBefore.left = 0; + opts.cssBefore.height = 0; + opts.animIn.top = 0; + opts.animOut.height = 0; +}; +$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,false); + opts.animIn.height = next.cycleH; + opts.animOut.top = curr.cycleH; + }); + opts.cssFirst.top = 0; + opts.cssBefore.left = 0; + opts.cssBefore.top = 0; + opts.cssBefore.height = 0; + opts.animOut.height = 0; +}; +$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,true); + opts.cssBefore.left = next.cycleW; + opts.animIn.width = next.cycleW; + }); + opts.cssBefore.top = 0; + opts.cssBefore.width = 0; + opts.animIn.left = 0; + opts.animOut.width = 0; +}; +$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,true); + opts.animIn.width = next.cycleW; + opts.animOut.left = curr.cycleW; + }); + $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 }); + opts.animIn.left = 0; + opts.animOut.width = 0; +}; + +// zoom +$.fn.cycle.transitions.zoom = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,false,true); + opts.cssBefore.top = next.cycleH/2; + opts.cssBefore.left = next.cycleW/2; + $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); + $.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }); + }); + opts.cssFirst.top = 0; + opts.cssFirst.left = 0; + opts.cssBefore.width = 0; + opts.cssBefore.height = 0; +}; + +// fadeZoom +$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,false); + opts.cssBefore.left = next.cycleW/2; + opts.cssBefore.top = next.cycleH/2; + $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); + }); + opts.cssBefore.width = 0; + opts.cssBefore.height = 0; + opts.animOut.opacity = 0; +}; + +// blindX +$.fn.cycle.transitions.blindX = function($cont, $slides, opts) { + var w = $cont.css('overflow','hidden').width(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts); + opts.animIn.width = next.cycleW; + opts.animOut.left = curr.cycleW; + }); + opts.cssBefore.left = w; + opts.cssBefore.top = 0; + opts.animIn.left = 0; + opts.animOut.left = w; +}; +// blindY +$.fn.cycle.transitions.blindY = function($cont, $slides, opts) { + var h = $cont.css('overflow','hidden').height(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts); + opts.animIn.height = next.cycleH; + opts.animOut.top = curr.cycleH; + }); + opts.cssBefore.top = h; + opts.cssBefore.left = 0; + opts.animIn.top = 0; + opts.animOut.top = h; +}; +// blindZ +$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { + var h = $cont.css('overflow','hidden').height(); + var w = $cont.width(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts); + opts.animIn.height = next.cycleH; + opts.animOut.top = curr.cycleH; + }); + opts.cssBefore.top = h; + opts.cssBefore.left = w; + opts.animIn.top = 0; + opts.animIn.left = 0; + opts.animOut.top = h; + opts.animOut.left = w; +}; + +// growX - grow horizontally from centered 0 width +$.fn.cycle.transitions.growX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,true); + opts.cssBefore.left = this.cycleW/2; + opts.animIn.left = 0; + opts.animIn.width = this.cycleW; + opts.animOut.left = 0; + }); + opts.cssBefore.top = 0; + opts.cssBefore.width = 0; +}; +// growY - grow vertically from centered 0 height +$.fn.cycle.transitions.growY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,false); + opts.cssBefore.top = this.cycleH/2; + opts.animIn.top = 0; + opts.animIn.height = this.cycleH; + opts.animOut.top = 0; + }); + opts.cssBefore.height = 0; + opts.cssBefore.left = 0; +}; + +// curtainX - squeeze in both edges horizontally +$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,false,true,true); + opts.cssBefore.left = next.cycleW/2; + opts.animIn.left = 0; + opts.animIn.width = this.cycleW; + opts.animOut.left = curr.cycleW/2; + opts.animOut.width = 0; + }); + opts.cssBefore.top = 0; + opts.cssBefore.width = 0; +}; +// curtainY - squeeze in both edges vertically +$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,false,true); + opts.cssBefore.top = next.cycleH/2; + opts.animIn.top = 0; + opts.animIn.height = next.cycleH; + opts.animOut.top = curr.cycleH/2; + opts.animOut.height = 0; + }); + opts.cssBefore.height = 0; + opts.cssBefore.left = 0; +}; + +// cover - curr slide covered by next slide +$.fn.cycle.transitions.cover = function($cont, $slides, opts) { + var d = opts.direction || 'left'; + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts); + opts.cssAfter.display = ''; + if (d == 'right') + opts.cssBefore.left = -w; + else if (d == 'up') + opts.cssBefore.top = h; + else if (d == 'down') + opts.cssBefore.top = -h; + else + opts.cssBefore.left = w; + }); + opts.animIn.left = 0; + opts.animIn.top = 0; + opts.cssBefore.top = 0; + opts.cssBefore.left = 0; +}; + +// uncover - curr slide moves off next slide +$.fn.cycle.transitions.uncover = function($cont, $slides, opts) { + var d = opts.direction || 'left'; + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,true,true); + if (d == 'right') + opts.animOut.left = w; + else if (d == 'up') + opts.animOut.top = -h; + else if (d == 'down') + opts.animOut.top = h; + else + opts.animOut.left = -w; + }); + opts.animIn.left = 0; + opts.animIn.top = 0; + opts.cssBefore.top = 0; + opts.cssBefore.left = 0; +}; + +// toss - move top slide and fade away +$.fn.cycle.transitions.toss = function($cont, $slides, opts) { + var w = $cont.css('overflow','visible').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + $.fn.cycle.commonReset(curr,next,opts,true,true,true); + // provide default toss settings if animOut not provided + if (!opts.animOut.left && !opts.animOut.top) + $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 }); + else + opts.animOut.opacity = 0; + }); + opts.cssBefore.left = 0; + opts.cssBefore.top = 0; + opts.animIn.left = 0; +}; + +// wipe - clip animation +$.fn.cycle.transitions.wipe = function($cont, $slides, opts) { + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.cssBefore = opts.cssBefore || {}; + var clip; + if (opts.clip) { + if (/l2r/.test(opts.clip)) + clip = 'rect(0px 0px '+h+'px 0px)'; + else if (/r2l/.test(opts.clip)) + clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; + else if (/t2b/.test(opts.clip)) + clip = 'rect(0px '+w+'px 0px 0px)'; + else if (/b2t/.test(opts.clip)) + clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; + else if (/zoom/.test(opts.clip)) { + var top = parseInt(h/2,10); + var left = parseInt(w/2,10); + clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)'; + } + } + + opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; + + var d = opts.cssBefore.clip.match(/(\d+)/g); + var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10); + + opts.before.push(function(curr, next, opts) { + if (curr == next) return; + var $curr = $(curr), $next = $(next); + $.fn.cycle.commonReset(curr,next,opts,true,true,false); + opts.cssAfter.display = 'block'; + + var step = 1, count = parseInt((opts.speedIn / 13),10) - 1; + (function f() { + var tt = t ? t - parseInt(step * (t/count),10) : 0; + var ll = l ? l - parseInt(step * (l/count),10) : 0; + var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h; + var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w; + $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); + (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); + })(); + }); + $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); + opts.animIn = { left: 0 }; + opts.animOut = { left: 0 }; +}; + +})(jQuery); \ No newline at end of file diff --git a/app/assets/javascripts/gallery.js b/app/assets/javascripts/gallery.js new file mode 100644 index 0000000..4ab5ac5 --- /dev/null +++ b/app/assets/javascripts/gallery.js @@ -0,0 +1,267 @@ +!function ($) { + $.fn.checkListLength = function (param){ + _defaultSettings = { + onlyOne: null, + }; + _set = $.extend(_defaultSettings, param); + $this = this; + $li = this.children('li'); + $dropzone = $('#dropzone'); + if(($li.length - _set.onlyOne) == 0) { + $('#dropzone').fadeIn(300); + } else { + $('#dropzone').fadeOut(300); + }; + $('#file-list').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); + } +}(window.jQuery); + +$(function () { + 'use strict'; + // Initialize the jQuery File Upload widget: + if($('#fileupload').length){ + $('#fileupload').fileupload({ + maxFileSize: 5000000, + acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, + dropZone: $('#dropzone'), + headers:{ + 'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content") + } + }); + } +}); + +$(function() { + var $container = $('.gallery'), + $containerData = $container.data(); + $container.imagesLoaded(function(){ + var $albumname = $('.albumname'), + $img = $('.rgalbum img'); + $('.rgalbum > a').rsImg(); + if($containerData.galleryId == 'gallery') { + $container.masonry({ + itemSelector : '.rgalbum', + isAnimated: true, + }); + $albumname.each(function(i) { + var $albumblock = $(this).closest('a').height(), + $H = $(this).outerHeight(true); + if($H > $albumblock) { + $(this).css({ + 'bottom': "auto", + 'top': 0, + }); + $(this).hover(function() { + $(this).stop(true, true).delay(500).animate({ + 'top': '-='+($H-$albumblock), + },($H-$albumblock)*10) + },function() { + $(this).stop(true, true); + $(this).css({ + 'bottom': "auto", + 'top': 0, + }); + }); + }; + }); + $('#orbit_gallery').delegate('.icons-tag', clickEvent, function(){ + $(this).parents('.gallery_info').nextAll('.albumtag').slideToggle(300, function() { + $container.masonry({ + itemSelector : '.rgalbum', + isAnimated: true, + }); + }); + }); + }; + }); + + var bindEvent = function(instance,elem){ + var $e = elem, + image_id = $e.closest(".rgalbum").data("image-id"); + obj = photosData.galleries.filter(function(a) { + return a.id == image_id; + })[0]; + switch($e.attr("for")){ + case "description": + if(obj.description){ + instance.find("textarea").each(function(){ + if(obj.description[$(this).attr("for")]) + $(this).val(obj.description[$(this).attr("for")]); + }) + + } + instance.find("input[type=hidden]").val(image_id); + instance.find("form").bind("ajax:success",function(evt, data, status){ + $.pageslide.close(); + photosData = data; + }) + break; + case "tags": + instance.find('.tags-groups').cardCheck({ + item: '.card' + }); + for(i = 0; i < obj.tags.length; i++){ + instance.find("input[value="+obj.tags[i]+"]").parent().addClass('active'); + instance.find("input[value="+obj.tags[i]+"]").prop("checked","checked"); + } + instance.find("form").submit(function(event) { + var checkboxes = $(this).find("input[type=checkbox]:checked"), + tag_ids = [], + image_ids =[image_id]; + + checkboxes.each(function(){ + tag_ids.push($(this).val()); + }) + + $.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){ + $.pageslide.close(); + photosData = json; + }) + return false; + }); + break; + case "batch": + instance.find('.tags-groups').cardCheck({ + item: '.card' + }); + instance.find("form").submit(function(event) { + var checkboxes = $(this).find("input[type=checkbox]:checked"), + tag_ids = [], + image_ids =[], + images = $("#imgholder .rgalbum.active"); + checkboxes.each(function(){ + tag_ids.push($(this).val()); + }) + images.each(function(){ + image_ids.push($(this).data("image-id")); + }) + $.post("/admin/galleries/image_tagging",{"image_ids":image_ids,"tag_ids":tag_ids},function(json){ + $.pageslide.close(); + photosData = json; + }) + return false; + }); + break; + } + } + + var photosData = null; + if($("#imgholder").length){ + $.getJSON(window.location.pathname, function(json, textStatus) { + photosData = json; + $('.open').pageslide({ + loadComplete: function(instance,elem) { + bindEvent(instance,elem); + } + }) + }); + } + + + + $("#imgholder").on(clickEvent, '.photo_cover', function(event) { + var image_id = $(this).closest(".rgalbum").data("image-id"), + album_id = $("#imgholder").data("gallery-id"), + set_cover = true; + if($(this).children().hasClass("icons-star-2")){ + $(".icons-star").removeClass("icons-star").addClass('icons-star-2'); + $(this).children().removeClass("icons-star-2").addClass("icons-star"); + }else{ + $(this).children().removeClass("icons-star").addClass("icons-star-2"); + set_cover = false; + } + $.post("/admin/galleries/set_cover",{"album_id":album_id,"image_id":image_id,"set_cover":set_cover}); + + }); + + $("#delete_selected_photos_btn").click(function(){ + var photos_to_delete = [], + delete_cover = false, + $photos = $(".rgalbum.active"), + album_id = $("#imgholder").data("gallery-id"); + $('.modal-body .spinning').fadeIn('fast'); + $('.modal-body .text-warning').hide(0); + $photos.each(function(){ + photos_to_delete.push($(this).data('image-id')); + if ($(this).find(".icons-star").length) { + delete_cover = true; + }; + }); + $.ajax({ + url : "/admin/galleries/delete_photos", + type : "POST", + data : {"images":photos_to_delete,"delete_cover":delete_cover,"album_id":album_id}, + success : function(){ + $photos.slideUp(300,function() { + $(this).remove(); + }); + $('#dialog').modal('hide'); + $('.modal-body .spinning').hide(); + $('.modal-body .text-warning').show(); + $('.deletephoto, .deselect, .addtags').addClass('hide') + } + }); + }) + + $('#imgholder').on(clickEvent, '.checkbox', function() { + $(this).prop('checked') ? $(this).closest('.rgalbum').addClass('active') : $(this).closest('.rgalbum').removeClass('active'); + var checkLength = $("#imgholder .rgalbum.active"); + checkLength.length ? $('.deletephoto, .deselect, .addtags').removeClass('hide') : $('.deletephoto, .deselect, .addtags').addClass('hide'); + }); + $('.deselect').on(clickEvent, function(event) { + $('.rgalbum').removeClass('active'); + $('.checkbox').prop('checked', false) + $('.deletephoto, .deselect, .addtags').addClass('hide') + event.preventDefault(); + }); + $('.phtot-action').delegate('li', clickEvent, function(event) { + $('.checkbox').prop('checked', false) + $('.rgalbum').removeClass('active'); + $('.deletephoto, .deselect, .addtags').removeClass('hide') + }); + + // + $('.add-imgs').on({ + click: function() { + $('#fileupload').slideToggle(300, function() { + if(!$(this).is(':hidden')) { + $('.add-imgs').html(' Close panel'); + $('.rgbody').stop(true, false).animate({'padding-bottom': 280}, 300); + } else { + $('.add-imgs').html(' Add Image'); + $('.files').empty() + $('#file-list').checkListLength(); + $('.rgbody').stop(true, false).animate({'padding-bottom': 0}, 300); + fetchNewImages(); + }; + }); + return false; + } + }); + var fetchNewImages = function(){ + var lastid = ( $("li.rgalbum:last").length ? $("li.rgalbum:last").data("image-id") : null), + albumid = $("#fileupload_aid").val(); + + $.getJSON(window.location.pathname, function(json, textStatus) { + photosData = json; + }); + + $.ajax({ + url : "/admin/new_images", + data : {"last_image_id" : lastid, "album_id" : albumid}, + success : function(data){ + var $e = $(data); + $imgs = $e.find("img"); + $("#imgholder").append($e); + $os = $e.find("a.open"); + $os.pageslide({ + loadComplete: function(instance,elem) { + bindEvent(instance,elem); + } + }); + } + }) + + } +}); + diff --git a/app/assets/javascripts/galleryAPI.js.erb b/app/assets/javascripts/galleryAPI.js.erb new file mode 100644 index 0000000..d52e08b --- /dev/null +++ b/app/assets/javascripts/galleryAPI.js.erb @@ -0,0 +1,278 @@ +<%# encoding: utf-8 %> +$.extend($.expr[':'], { + 'containsi': function (elem, i, match, array) { + return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; + } +}); +var galleryAPI = function(){ + g = this; + this.urlVars = rcom.getUrlVars(); + this.albumArea = $("#orbit_gallery"); + this.loadArea = null; + this.tagList = $("ul#gallery_tag_list"); + this.loading = $("#loading"); + + this.loadTheater = function(id){ + + g.loadstart(); + var imageArray; + var imagecount = 0; + var picHeight = 0; + var bindHandlers = function(){ + var $slidelist = $('.slidelist'), + $rslide = $('.rslide'), + $rslidenav = $('.rslidenav'), + $img = $("#main_pic img"), + wHeight = $(window).height(); + + $("#main_pic").height(picHeight); + $img.height("100%"); + + $('.bt-tag').click(function(){ + if(!$(this).hasClass("active")) + updatePhotoTag(); + $(this).toggleClass("active"); + var $tag_panel = $('#tag_panel'), + tag_panel_position = 0; + + if( $tag_panel.css('right') == '0px' ){ + tag_panel_position = -200; + } + $tag_panel.animate({'right':tag_panel_position}, 300); + + g.albumArea + .delay(200) + .animate({'margin-right':tag_panel_position+200},300); + return false; + }); + var updatePhotoTag = function(){ + var tags = imageArray[imagecount].tag_ids; + if(tags.length > 0 && g.tagList.find("li").length == 0){ + var tagnames = imageArray[imagecount].tag_names; + g.tagList.empty(); + for(i in tagnames){ + $li = $("
  • "+tagnames[i]+"
  • "); + g.tagList.append($li); + } + }else if(tags.length > 0 && g.tagList.find("li").length > 0) { + g.tagList.find("input").attr("checked",false); + for(tag in tags){ + g.tagList.find("li[data-content="+tags[tag]+"] input").attr("checked",true); + } + }else if(tags.length == 0){ + if(g.tagList.find("input").length == 0) + g.tagList.empty(); + else + g.tagList.find("input").attr("checked",false); + } + } + g.albumArea.find("#tag_search_box").keyup(function(e){ + sval = $(this).val(); + if(sval == "<%= I18n.t('gallery.search_tags') %>") + sval = ""; + sval = sval.replace(/(^\s*)|(\s*$)/g,''); + if(sval){ + var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range + var re2 = new RegExp("^[\uE7C7-\uE7F3]*$"); + if ((re1.test(sval) && (re2.test(sval)))){ + $("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp(); + }else{ + $("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp(); + } + + }else{ + $("#gallery_tag_list li").slideDown(); + } + }) + g.albumArea.find("#tag_panel .bt-save").click(function(){ + g.saveTags(imageArray[imagecount]._id,"pic",function(tagids){ + imageArray[imagecount].tag_ids = tagids; + }) + }) + $(".slidectrl a.togglelist").click(function(){ + var rslide_h = $rslide.outerHeight(); + if ( $slidelist.height() < 1 ){ + $slidelist.stop().animate({'height':rslide_h - 30}, 300); + $slidelist.find("ul").show(); + } else { + $slidelist.stop().animate({'height':'0px'}, 300); + $slidelist.find("ul").hide(); + } + }) + $(".slidectrl .togglescreen").click(function(){ + toggleFullscreen(); + }) + $(".slidectrl .browserfullscreen").click(function(){ + browserFullScreen(); + }) + $slidelist.find(".list_element").click(function(){ + imagecount = parseInt($(this).parent().attr("for")); + changeImage($(this)); + }) + $rslidenav.find(".navN").click(function(){ + nextpic($(this)); + }) + $rslidenav.find("a.navP").click(function(){ + prevpic($(this)); + }) + $("#nextpic").click(function(){ + nextpic($(this)); + }) + + $(document).keydown(function(e){ + if (e.keyCode == 37){ + prevpic($rslidenav.find(".navP")); + return false; + } + if(e.keyCode == 39){ + nextpic($rslidenav.find(".navN")); + return false; + } + if(e.keyCode == 27){ + toggleFullscreen(); + $rslide.removeClass('browserFullScreen'); + return false; + } + if(e.keyCode == 70 || e.keyCode == 102){ + if($rslide.hasClass("fullscreen")) + browserFullScreen(); + } + }); + var browserFullScreen = function(){ + var el = document.documentElement, + rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen; + rfs.call(el); + } + $(window).resize(function(){ + if(window.innerWidth == screen.width && window.innerHeight == screen.height) { + $rslide.addClass('browserFullScreen'); + } else { + $rslide.removeClass('browserFullScreen'); + } + }) + var nextpic = function(dom){ + if(imagecount == imageArray.length - 1) + imagecount = 0; + else + imagecount++; + changeImage(dom); + } + var prevpic = function(dom){ + if(imagecount == 0) + imagecount = imageArray.length - 1 + else + imagecount--; + changeImage(dom); + } + var toggleFullscreen = function(){ + if($rslide.hasClass("fullscreen")){ + $rslide.css("position","relative"); + $rslide.removeClass("fullscreen"); + $(".slidectrl .browserfullscreen").hide(); + $img.css({"padding":""}) + $("#main_pic").height(picHeight ); + }else{ + $("#main_pic").height(wHeight); + // $img.height("100%"); + $rslide.css("position",""); + $rslide.addClass("fullscreen"); + $img.css({"padding":($rslide.height()-$img.height())/2}) + $(".slidectrl .browserfullscreen").show(); + } + } + var changeImage = function(dom){ + var pageurl = dom.attr('href'); + + $img.fadeOut(200,function(){ + g.loadstart(); + $img.attr("src",""); + $img.attr({"src":dom.attr("data-content"),"height":picHeight+"px"}).load(function(){ + $img.fadeIn(200); + g.loadcomplete(); + }); + + + if($rslide.hasClass("fullscreen")){ + $img.css({"padding":($rslide.height()-$img.height())/2}) + } + $slidelist.stop().animate({'height':'0px'}, 300); + $slidelist.find("ul").hide(); + if(rcom.getInternetExplorerVersion() == -1){ + if(pageurl!=window.location){ + window.history.pushState({path:pageurl},'',pageurl); + } + }else{ + window.location.hash = pageurl; + } + // $(".slideinfo b.info").text(imageArray[imagecount].title); + if($('.bt-tag').hasClass("active")) + updatePhotoTag(); + if(imageArray[imagecount].description) + $(".slideinfo .info").text(imageArray[imagecount].description); + else + $(".slideinfo .info").text(""); + if(imageArray.length > 1) + updateNavigation(); + }) + + } + var updateNavigation = function(){ + var next, prev; + if(imagecount == 0){ + next = 1; + prev = imageArray.length - 1; + }else if(imagecount == imageArray.length - 1){ + next = 0 + prev = imageArray.length - 2; + }else{ + next = imagecount + 1; + prev = imagecount - 1; + } + $(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url}); + $(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url}); + }; + if(imageArray.length > 1) + updateNavigation(); + } + + var preparestage = function(albumid){ + $.getJSON("../galleries/"+albumid+"/imgs",function(album){ + imageArray = eval(album.images); + $.each(album.images,function(i,image){ + if(image._id == id) + imagecount = i; + }) + bindHandlers(); + }) + } + + if(rcom.getInternetExplorerVersion()!=-1){ + var photo_id = window.location.hash.replace("#",""); + if(photo_id){ + var url = window.location.href; + var params = url.split("/"); + // params[params.length-1] = photo_id; + url = url.replace(params[params.length-1],photo_id); + + window.location.href = url; + } + } + + var albumid = $("#main_pic").attr("data-content"); + g.albumArea.find(".bt-back").attr("href","../galleries/"+albumid); + g.albumArea.find(".bt-edit").attr("href","../albums/"+albumid+"/edit"); + g.albumArea.css("margin-bottom","0"); + picHeight = $(window).height() - ($("#orbit-bar").outerHeight() + $("#orbit_gallery .form-actions").outerHeight()); + preparestage(albumid); + + } + this.loadcomplete = function(){ + g.loading.hide(); + } + this.loadstart = function(){ + g.loading.show(); + } + +} + galleryAPI.prototype.locale = "<%= I18n.locale %>"; + diff --git a/app/assets/javascripts/galleryAPI_frontend.js.erb b/app/assets/javascripts/galleryAPI_frontend.js.erb new file mode 100644 index 0000000..91f1efa --- /dev/null +++ b/app/assets/javascripts/galleryAPI_frontend.js.erb @@ -0,0 +1,253 @@ +<%# encoding: utf-8 %> +$.extend($.expr[':'], { + 'containsi': function (elem, i, match, array) { + return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; + } +}); +var galleryAPI = function(){ + g = this; + this.urlVars = rcom.getUrlVars(); + this.albumArea = $("#orbit_gallery"); + this.loadArea = "theater"; + this.tagList = $(".taglist ul"); + this.loading = $("#loading"); + // this.authenticated = false; + this.initialize = function(callbackFn){ + if(g.loadArea == "theater"){ + if(rcom.getInternetExplorerVersion()!=-1){ + var photo_id = window.location.hash.replace("#",""); + if(photo_id){ + var params = rcom.getUrlVars(); + var url = window.location.href.split("?")[0]; + params["image_id"] = photo_id; + for(i=0;i"+tags[tag].name+""); + } + + } + + + $(".slidectrl a.togglelist").click(function(){ + var rslide_h = $rslide.outerHeight(); + if ( $slidelist.height() < 1 ){ + $slidelist.stop().animate({'height':rslide_h - 30}, 300); + $slidelist.find("ul").show(); + } else { + $slidelist.stop().animate({'height':'0px'}, 300); + $slidelist.find("ul").hide(); + } + }) + $(".slidectrl .togglescreen").click(function(){ + toggleFullscreen(); + }) + $(".slidectrl .browserfullscreen").click(function(){ + browserFullScreen(); + }) + $slidelist.find(".list_element").click(function(){ + imagecount = parseInt($(this).parent().attr("for")); + changeImage($(this)); + }) + $rslidenav.find(".navN").click(function(){ + nextpic($(this)); + }) + $rslidenav.find("a.navP").click(function(){ + prevpic($(this)); + }) + $("#nextpic").click(function(){ + nextpic($(this)); + }) + + $(document).keydown(function(e){ + if (e.keyCode == 37){ + prevpic($rslidenav.find(".navP")); + return false; + } + if(e.keyCode == 39){ + nextpic($rslidenav.find(".navN")); + return false; + } + if(e.keyCode == 27){ + toggleFullscreen(); + $rslide.removeClass('browserFullScreen'); + return false; + } + if(e.keyCode == 70 || e.keyCode == 102){ + if($rslide.hasClass("fullscreen")) + browserFullScreen(); + } + }); + var browserFullScreen = function(){ + var el = document.documentElement, + rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen; + rfs.call(el); + } + $(window).resize(function(){ + if(window.innerWidth == screen.width && window.innerHeight == screen.height) { + $rslide.addClass('browserFullScreen'); + } else { + $rslide.removeClass('browserFullScreen'); + } + }) + var nextpic = function(dom){ + if(imagecount == imageArray.length - 1) + imagecount = 0; + else + imagecount++; + changeImage(dom); + } + var prevpic = function(dom){ + if(imagecount == 0) + imagecount = imageArray.length - 1 + else + imagecount--; + changeImage(dom); + } + var toggleFullscreen = function(){ + if($rslide.hasClass("fullscreen")){ + $rslide.css("position","relative"); + $rslide.removeClass("fullscreen"); + $(".slidectrl .browserfullscreen").hide(); + $img.css({"padding":""}) + $("#main_pic").height("auto"); + }else{ + $("#main_pic").height(wHeight); + $img.css("height","auto"); + $rslide.css("position",""); + $rslide.addClass("fullscreen"); + $img.css({"padding":($rslide.height()-$img.height())/2}) + $(".slidectrl .browserfullscreen").show(); + } + } + var changeImage = function(dom){ + var pageurl = dom.attr('href'); + + $img.fadeOut(200,function(){ + g.loadstart(); + if($rslide.hasClass("fullscreen")){ + + $img.attr({"src":dom.attr("data-content")}).css("height","100%").load(function(){ + g.loadcomplete(); + $img.fadeIn(200); + }); + }else{ + $img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){ + g.loadcomplete(); + $img.fadeIn(200); + });; + } + if($rslide.hasClass("fullscreen")){ + $img.css({"padding":($rslide.height()-$img.height())/2}) + } + $slidelist.stop().animate({'height':'0px'}, 300); + $slidelist.find("ul").hide(); + if(rcom.getInternetExplorerVersion() == -1){ + if(pageurl!=window.location){ + var segments = window.location.pathname.split("/"), + uid = segments[segments.length-1]; + pageurl = window.location.pathname.replace(uid,"-"+pageurl)+"?method=theater"; + window.history.pushState({path:pageurl},'',pageurl); + } + }else{ + window.location.hash = pageurl; + } + // $(".slideinfo b.info").text(imageArray[imagecount].title); + updatePhotoTag(); + if(imageArray[imagecount].description) + $(".slideinfo .info").text(imageArray[imagecount].description); + else + $(".slideinfo .info").text(""); + if(imageArray.length > 1) + updateNavigation(); + }) + + } + var updateNavigation = function(){ + var next, prev; + if(imagecount == 0){ + next = 1; + prev = imageArray.length - 1; + }else if(imagecount == imageArray.length - 1){ + next = 0 + prev = imageArray.length - 2; + }else{ + next = imagecount + 1; + prev = imagecount - 1; + } + $(".navN").attr({"href":imageArray[next]._id,"data-content":imageArray[next].file.theater.url}); + $(".navP").attr({"href":imageArray[prev]._id,"data-content":imageArray[prev].file.theater.url}); + }; + if(imageArray.length > 1) + updateNavigation(); + } + + var preparestage = function(albumid){ + $.getJSON("/admin/galleries/"+albumid+"/imgs", function(album){ + imageArray = eval(album.images); + $.each(album.images,function(i,image){ + if(image._id == id) + imagecount = i; + }) + bindHandlers(); + }) + } + // if(rcom.getInternetExplorerVersion()!=-1){ + // var url_constructor = window.location.href.split("/"); + // var url = ""; + // for(x=0;x<=url_constructor.length-1;x++){ + // if(x == url_constructor.length-1){ + // url+="#!/"+url_constructor[x]; + // }else{ + // url+=url_constructor[x]+"/"; + // } + // } + + // window.location.href = url; + // } + + var albumid = $("#main_pic").attr("data-content"); + g.albumArea.css("margin-bottom","0"); + // picHeight = $(window).height() - ($("#orbit-bar").outerHeight() + $("#orbit_gallery .form-actions").outerHeight()); + preparestage(albumid); + + } + this.loadcomplete = function(){ + g.loading.hide(); + } + this.loadstart = function(){ + g.loading.show(); + } + +} +galleryAPI.prototype.locale = "en"; diff --git a/app/assets/javascripts/gallery_old.js b/app/assets/javascripts/gallery_old.js new file mode 100644 index 0000000..a683941 --- /dev/null +++ b/app/assets/javascripts/gallery_old.js @@ -0,0 +1 @@ +//= require galleryAPI \ No newline at end of file diff --git a/app/assets/javascripts/jquery.lite.image.resize.js b/app/assets/javascripts/jquery.lite.image.resize.js new file mode 100644 index 0000000..27873c3 --- /dev/null +++ b/app/assets/javascripts/jquery.lite.image.resize.js @@ -0,0 +1,136 @@ +/* =================================================== + * jquery-lite-image-resize v.1.0.1 + * https://github.com/RayChang/jquery-lite-image-resize + * =================================================== + * How to use ? + * + * HTML element closest to the image to add class "resizeimg". + * + * Example: + *
    + * + *
    + * + * Or you can use: + * $('your class').rsImg(); + * + * Note : HTML structure must be a structure like the example above. + * +*/ + +!function ($) { + + "use strict"; + + var ResizeImg = function(element, elementLength, i) { + this.element = $(element); + this.element.data('exists', true); + this.elementLength = elementLength; + this.index = i; + }; + ResizeImg.prototype.resize = function(callback) { + var $img = this.element.children('img').eq(0), + elW = this.element.innerWidth(), + elH = this.element.innerHeight(), + elScale = elW/elH, + ell = this.elementLength, + index = this.index, + image = document.createElement("img"); + image.src = $img.attr('src'); + this.element.css({ + 'position': 'relative', + 'overflow': 'hidden', + }); + function imageLoadComplete() { + var imgW = image.width, + imgH = image.height, + imgScale = imgW/imgH, + portrait = { + 'position': 'absolute', + 'height': '100%', + 'width': 'auto', + 'max-width': 'none', + 'left': '50%', + 'top': 0, + 'margin-left': imgW*(elH/imgH)/-2 + }, + landscape = { + 'position': 'absolute', + 'height': 'auto', + 'max-height': 'none', + 'width': '100%', + 'left': 0, + 'top': '50%', + 'margin-top': imgH*(elW/imgW)/-2 + }, + center = { + 'position': 'absolute', + 'height': '100%', + 'width': '100%', + 'top': 0, + 'left': 0 + }; + if(imgScale < 1) { + if(elScale < 1) { + if(elScale > imgScale) { + $img.css(landscape); + } else { + $img.css(portrait); + }; + } else { + $img.css(landscape); + }; + }; + + if(imgScale > 1) { + if(elScale > 1) { + if(elScale > imgScale) { + $img.css(landscape); + } else { + $img.css(portrait); + }; + } else { + $img.css(portrait); + }; + }; + + if(imgScale == 1) { + if(elScale < 1) { + $img.css(portrait); + } else if(elScale > 1) { + $img.css(landscape); + } else { + $img.css(center); + }; + }; + $img.fadeTo(500, 1); + + if(index == ell && callback) { + ResizeImg.prototype.callback(callback) + } + } + if(/MSIE 8.0/g.test($ua)) { + imageLoadComplete(); + } else { + image.onload = imageLoadComplete; + } + }; + + ResizeImg.prototype.callback = function(callback) { + callback(); + }; + + $.fn.rsImg = function (callback) { + var elementLength = this.length - 1; + this.each(function (i) { + if(!$(this).data('exists')) { + $(this).children("img").fadeTo(0,0); + new ResizeImg(this, elementLength, i).resize(callback); + }; + }); + }; + + $(function() { + $('.resizeimg').rsImg(); + }); +}(window.jQuery); diff --git a/app/assets/javascripts/jquery.masonry.min.js b/app/assets/javascripts/jquery.masonry.min.js new file mode 100644 index 0000000..57c081c --- /dev/null +++ b/app/assets/javascripts/jquery.masonry.min.js @@ -0,0 +1,10 @@ +/** + * jQuery Masonry v2.1.08 + * A dynamic layout plugin for jQuery + * The flip-side of CSS Floats + * http://masonry.desandro.com + * + * Licensed under the MIT license. + * Copyright 2012 David DeSandro + */ +(function(e,t,n){"use strict";var r=t.event,i;r.special.smartresize={setup:function(){t(this).bind("resize",r.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",r.special.smartresize.handler)},handler:function(e,t){var n=this,s=arguments;e.type="smartresize",i&&clearTimeout(i),i=setTimeout(function(){r.dispatch.apply(n,s)},t==="execAsap"?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Mason=function(e,n){this.element=t(n),this._create(e),this._init()},t.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},t.Mason.prototype={_filterFindBricks:function(e){var t=this.options.itemSelector;return t?e.filter(t).add(e.find(t)):e},_getBricks:function(e){var t=this._filterFindBricks(e).css({position:"absolute"}).addClass("masonry-brick");return t},_create:function(n){this.options=t.extend(!0,{},t.Mason.settings,n),this.styleQueue=[];var r=this.element[0].style;this.originalStyle={height:r.height||""};var i=this.options.containerStyle;for(var s in i)this.originalStyle[s]=r[s]||"";this.element.css(i),this.horizontalDirection=this.options.isRTL?"right":"left";var o=this.element.css("padding-"+this.horizontalDirection),u=this.element.css("padding-top");this.offset={x:o?parseInt(o,10):0,y:u?parseInt(u,10):0},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var a=this;setTimeout(function(){a.element.addClass("masonry")},0),this.options.isResizable&&t(e).bind("smartresize.masonry",function(){a.resize()}),this.reloadItems()},_init:function(e){this._getColumns(),this._reLayout(e)},option:function(e,n){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))},layout:function(e,t){for(var n=0,r=e.length;n"; + for(i=current_year;i>=year;i--){ + dthtml+=""; + } + dthtml+=" Date: Month: "; + dom.html(dthtml); +}, + +//loading overlay around a dom... +loadingWrapper : function(dom, display){ + if(display){ + dom.prepend("
    "); + $rss("#loading_wrapper").height(dom.height()); + $rss("#loading_wrapper").width(dom.width()); + }else{ + domId=dom.attr("id"); + $rss("#"+domId+" #loading_wrapper").remove(); + } + }, + +//validating a dom.... +validate : function(dom, validation, errormsg){ + var domValue = dom.val(); + var error = false; + var regex=""; + var msg = ""; + switch(validation){ + case "required": + if(domValue=="")error=true; + msg="Cannot be empty."; + break; + case "email": + regex=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; + msg="Invalid Email Address."; + break; + case "number": + regex=/^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/; + msg = "Only numbers are accepted."; + break; + case "alphanumeric": + regex=/^\s*[a-zA-Z0-9,\s]+\s*$/; + msg="Only numbers, alphabets and spaces are allowed."; + break; + } + domId=dom.attr("name"); + if(errormsg=="")errormsg=msg; + if(regex!="")if(!regex.test(domValue))error=true; + if(error){$rss("#"+domId+"_error").remove();dom.after(""+errormsg+"");return false;} else{ $rss("#"+domId+"_error").remove();return true;} + }, + +bindToSpinner : function(dom,data,callbackFn){ + var domId = dom.attr("id"); + var dhtml=""; + var spinnerValue=Array(); + var spinnerDisplay=Array(); + $rss.each(data,function(i,it){ + $rss.each(data[i],function(key,it){ + spinnerValue.push(it); + }); + }); + dhtml=""; + dom.html(dhtml); + if(typeof callbackFn=="function") + callbackFn.call(this, dhtml); + }, + + //binds the recieved json to a table +bindToTable : function(dom,data,headers,actions,css_class,callbackFn){ + if(!css_class)css_class=""; + var dhtml=""; + var domId = dom.attr("id"); + if(actions){ + var btnTitles=Array(); + var btnFunctions=Array(); + $rss.each(actions,function(title,func){ + btnTitles.push(title); + btnFunctions.push(func); + }); + rcom.translate(btnTitles,function(convertedData){ + btnTitles=convertedData.slice(); + + rcom.translate(headers,function(convertedData){ + headers=convertedData; + if(!data)return; + $rss.each(headers,function(i,head){ + dhtml+=""; + }); + dhtml+=""; + if(data.length==0)dhtml+=""; + $rss.each(data,function(i,item){ + var cl=""; + if(i%2!=0)cl="even"; + dhtml+=""; + $rss.each(item,function(i,it){ + if(i!="id"){ + if(it==null)it="Not Set"; + dhtml+=""; + } + }) + dhtml+=""; + dhtml+=""; + }); + dhtml+="
    "+head+"
    No Data
    "+it+""; + for(x=0;x"+btnTitles[x]+""; + } + dhtml+="
    "; + dom.html(dhtml); + }); + }); + }else{ + rcom.translate(headers,function(convertedData){ + headers=convertedData; + if(!data)return; + if(headers.length>0){ + $rss.each(headers,function(i,head){ + dhtml+=""+head+""; + }); + } + dhtml+=""; + if(data.length==0)dhtml+="No Data"; + + $rss.each(data,function(i,item){ + var cl=""; + if(i%2!=0)cl="even"; + dhtml+=""; + $rss.each(item,function(i,it){ + if(i!="id"){ + if(it==null)it="Not Set"; + dhtml+=""+it+""; + } + }) + dhtml+=""; + }); + dhtml+=""; + dom.html(dhtml); + }); + } + + if(typeof callbackFn=="function") + callbackFn.call(this, dhtml); +}, + //convert to date string which can be directly inserted in database or according to any format. +convertToInsertableDate : function(y,m,d,format){ + var dt=""; + if(m<10)m="0"+m; + if(d<10)d="0"+d; + switch(format){ + case "yyyy-mm-dd": + dt= y+"-"+m+"-"+d; + break; + case "dd-mm-yyyy": + dt= d+"-"+m+"-"+y; + break; + case "mm-dd-yyyy": + dt= m+"-"+d+"-"+y; + break; + default: + dt= y+"-"+m+"-"+d; + break; + } + return dt; + }, +//a fucntion to show specific divs and hide all other +showDoms : function(doms){ + $rss("body").find("div").each(function(){$rss(this).hide();}); + $rss.each(doms,function(i,dom){ + dom.show(); + }); + }, + +//a function to translate the word or array.. +translate : function(data,callbackFn){ + var cdata=""; + var status =true; + if(!data){ + if(typeof callbackFn=="function") + callbackFn.call(this,cdata); + status=false; + } + if(data==""){ + if(typeof callbackFn=="function") + callbackFn.call(this,cdata); + status=false; + } + if(status){ + $rss.getJSON("../../classes/translate.php", {fn:"translateThis",tData:data},function(convertedData){ + if(typeof callbackFn=="function") + callbackFn.call(this, convertedData); + }); + } + }, + +// a function to bind JSON to list +bindToList : function(dom,data,callbackFn){ + var domId = dom.attr("id"); + var dhtml=""; + var listValue=Array(); + var listDisplay=Array(); + $rss.each(data,function(i,it){ + $rss.each(data[i],function(key,it){ + listValue.push(it); + }); + }); + dhtml=""; + dom.html(dhtml); + if(typeof callbackFn=="function") + callbackFn.call(this,dhtml); + }, +makeDraggable : function(handler,dom){ + handler.css("position","absolute"); + dom.css("position","absolute"); + var puranix=0; + var nayeex=0; + var puraniy=0; + var nayeey=0; + var offset=""; + var zIndex=dom.css("z-index"); + handler.mousedown(function(e){ + puranix=e.clientX; + puraniy=e.clientY; + offset=dom.offset(); + $rss(this).mousemove(function(e){ + nayeex=e.clientX-puranix; + nayeex+=offset.left; + nayeey=e.clientY-puraniy; + nayeey+=offset.top; + dom.css({"left":nayeex+"px","top":nayeey+"px","z-index":"9999"}); + }) + }).mouseup(function(){ + $rss(this).unbind("mousemove"); + dom.css("z-index",zIndex); + }) + }, + +//automatically scrolls to the bottom of the div +scrollToBottom : function(dom){ + var domId = dom.attr("id"); +// var domScrollHeight = document.getElementById(domId).scrollHeight; + var obj = document.getElementById(domId); + + if((obj.scrollTop+100) >= (obj.scrollHeight - obj.offsetHeight)) + dom.scrollTop(obj.scrollHeight); + }, + +/*ajax loading of images... needs following settings +dom:in which images ve to be loaded +url:the server url for making ajax calls +limit:how many images to load +divClass:the class of div surrounding each image +nameClass:class for span showing name +fn:function to be called in on the server +imageSrc:the image source of all the images. +bindTo:to bind images to a onclick function or else will be binded to normal a tag. +urlKey:to specify the key of the value.. if bindTo is used, this will be neglected.. +returns json; +*/ +loadImages : function(settings,callbackFn){ + + var dom = settings.dom; + var domid= dom.attr("id"); + var temp_array=Array(); + var starting = $rss("#"+domid+" img:last").attr("id"); + if(typeof starting != 'undefined'){ + starting = starting.substr(4,starting.length-1); + }else{starting = 0}; + var temp_var=""; + var json = ""; + var dhtml=""; + var extraparam=""; + if(typeof settings.extraParam != "undefined"){ + extraparam = settings.extraParam; + } + $rss.getJSON(settings.url,{fn:settings.fn,id:settings.whereId,limit:settings.limit,start:starting,extra:extraparam},function(images){ + json = eval(images); + $rss.each(images,function(i,pic){ + var temp_array=Array(); + var a_var=Array(); + var name_var=""; + var title=""; + $rss.each(pic,function(i,value){ + temp_array.push(value); + }) + if(temp_array.length>=4){ + name_var=""+temp_array[3]+"" + } + if(temp_array[2]==null) + title = ""; + else + title = temp_array[2]; + if(typeof settings.bindTo!="undefined"){ + a_var[1]="onclick='"+settings.bindTo+"("+temp_array[0]+");return false;'"; + a_var[0]=""; + }else{a_var[0]='?'+settings.urlKey+'='+temp_array[0];a_var[1]="";} + dhtml="
    "+name_var; + dom.delay(100).append(dhtml); + $rss("#pic_"+pic.id).delay(100).fadeIn(200); + + }) + if(typeof callbackFn=="function") + callbackFn.call(this,json); + }) + + + }, + +//function to get url variables... +getUrlVars : function(){ + var vars = [], hash; + var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); + for(var i = 0; i < hashes.length; i++){ + hash = hashes[i].split('='); + vars.push(hash[0]); + vars[hash[0]] = hash[1]; + } + if(vars[0] == window.location.href){ + vars =[]; + } + return vars; +}, +/*function to open a modalwindow on a page.. self reliant no images, no css needed. +settings + +width:in percentage or pixcel +height:in percentage or pixcel +closeBtn:true or false +envClose:closing through background click, true or flase +loadDiv:load html from a div +loadPage:load a page +loadHtml: load html + +*/ +modalWindow : function(settings,callbackFn){ + + var envClose = settings.envClose; + var dhtml=""; + if(typeof envClose == "undefined") + envClose = true; + var closeBtn = settings.closeBtn; + if(typeof closeBtn == "undefined") + closeBtn = true; + + var rgmaskHeight = $rss(window).height(); + var rgmaskWidth = $rss(window).width(); + var tempheight = settings.height; + var tempwidth = settings.width; + + var maxheight = (rgmaskHeight*85)/100; + var maxwidth = (rgmaskWidth*85)/100; + + if(typeof tempheight!="undefined"){ + tempheight = tempheight.toString(); + if(tempheight.charAt(tempheight.length-1)=='%') + tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100; + if(tempheight>maxheight) + tempheight=maxheight; + }else{tempheight="auto";} + if(typeof tempwidth!="undefined"){ + tempwidth = tempwidth.toString(); + if(tempwidth.charAt(tempwidth.length-1)=='%') + tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100; + if(tempwidth>maxwidth) + tempwidth=maxwidth; + }else{tempwidth="auto";} + $rss("body").append('
    '); + $rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.5,'z-index':199}); + $rss("body").append('
    '); + $rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 1px #ccc", "padding": "10px", "border-radius": "5px", "-webkit-border-radius": "5px", "-moz-border-radius": "5px", "-ms-border-radius": "5px", "box-shadow": "0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.7)"}); + var rgWTop = (rgmaskHeight-20)/2; + var rgWLeft = (rgmaskWidth-20)/2; + $rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"}); + if(typeof settings.loadDiv!="undefined"){ + dhtml = $rss(settings.loadDiv).html(); + $rss("#rgWindow").html(dhtml).hide(); + prepareWindow(); + } + if(typeof settings.loadHtml!="undefined"){ + dhtml = settings.loadHtml; + $rss("#rgWindow").html(dhtml).hide(); + prepareWindow(); + } + if(typeof settings.loadPage!="undefined"){ + $rss("#rgWindow").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();}); + } + function prepareWindow(){ + if(tempheight!="auto") + rgWTop = (rgmaskHeight-tempheight)/2; + else{ + tempheight=$rss("#rgWindow").height()+30; + if(tempheight>maxheight) + tempheight=maxheight; + rgWTop=(rgmaskHeight-tempheight)/2; + } + if(tempwidth!="auto") + rgWLeft = (rgmaskWidth-tempwidth)/2; + else{ + tempwidth=$rss("#rgWindow").width(); + if(tempwidth>maxwidth) + tempwidth=maxwidth; + rgWLeft=(rgmaskWidth-tempwidth)/2; + } + tempwidth=parseInt(tempwidth)+25; + $rss("#rgWindow").empty().show(); + var closebtn = ""; + if(closeBtn) + closebtn='X'; + $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"
    "+dhtml+"
    "); + $rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");}) + $rss("#close_modal").click(function(){rcom.modalWindowClose(); return false;}) + if(envClose) + $rss("#rgsheath").click(function(){ + rcom.modalWindowClose(); + }) + $rss(document).one("keydown",function(e){ + if (e.keyCode == 27){ + rcom.modalWindowClose(); + return false; + } + }) + + if(typeof callbackFn=="function") + callbackFn.call(this,$rss("#rgWindow")); + }); + } +}, +modalWindowUpdate : function(settings,callbackFn){ + var rgmaskHeight = $rss(window).height(); + var rgmaskWidth = $rss(window).width(); + var tempheight = settings.height; + var tempwidth = settings.width; + var dhtml = ""; + var maxheight = (rgmaskHeight*85)/100; + var maxwidth = (rgmaskWidth*85)/100; + if(typeof tempheight!="undefined"){ + tempheight = tempheight.toString(); + if(tempheight.charAt(tempheight.length-1)=='%') + tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100; + if(tempheight>maxheight) + tempheight=maxheight; + }else{tempheight="auto";} + if(typeof tempwidth!="undefined"){ + tempwidth = tempwidth.toString(); + if(tempwidth.charAt(tempwidth.length-1)=='%') + tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100; + if(tempwidth>maxwidth) + tempwidth=maxwidth; + }else{tempwidth="auto";}; + $rss("body").append("
    "); + + if(typeof settings.loadDiv!="undefined"){ + dhtml = $rss("#"+settings.loadDiv).html(); + $rss("#rgwindow_temp_div").html(dhtml).hide(); + prepareWindow(); + } + if(typeof settings.loadHtml!="undefined"){ + dhtml = settings.loadHtml; + $rss("#rgwindow_temp_div").html(dhtml).hide(); + prepareWindow(); + } + if(typeof settings.loadPage!="undefined"){ + $rss("#rgwindow_temp_div").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();}); + } + function prepareWindow(){ + if(tempheight!="auto") + rgWTop = (rgmaskHeight-tempheight)/2; + else{ + tempheight=$rss("#rgwindow_temp_div").height()+30; + if(tempheight>maxheight) + tempheight=maxheight; + rgWTop=(rgmaskHeight-tempheight)/2; + } + if(tempwidth!="auto") + rgWLeft = (rgmaskWidth-tempwidth)/2; + else{ + tempwidth=$rss("#rgwindow_temp_div").width(); + if(tempwidth>maxwidth) + tempwidth=maxwidth; + rgWLeft=(rgmaskWidth-tempwidth)/2; + } + tempwidth=parseInt(tempwidth)+25; + $rss("#rgContent").empty(); + $rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)}); + $rss("#rgwindow_temp_div").remove(); + } +}, +modalWindowClose : function(callbackFn){ + if($rss("#rgWindow").length>0){ + $rss("#rgWindow").empty(); + var rgmaskHeight = $rss(window).height(); + var rgmaskWidth = $rss(window).width(); + var x = (rgmaskHeight-20)/2; + var y = (rgmaskWidth-20)/2 + $rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();}) + } + if(typeof callbackFn=="function") + callbackFn.call(this,"harry"); +}, +bindDomToHead : function(dom){ + var gc = dom.css("background"); + var t = dom.offset(); + var gw = dom.width(); + $rss(window).scroll(function(){ + var wt = $rss(window).scrollTop(); + if ( wt > t.top ) { + var cssObj = { + 'position':'fixed', + 'top':0, + 'width':gw, + 'background':gc, + 'box-shadow':'0 1px 0 rgba(0,0,0,0.2)', + 'z-index':99 + } + dom.css(cssObj); + } else { + dom.attr('style',""); + } + }); +}, +progressBar : function(dom,settings){ + var domid = dom.prop("id"); + if($rss("#rss_progressbar_div_"+domid).length==0){ + if(typeof settings.top == "undefined") + settings.value = 1; + if(typeof settings.top == "undefined") + settings.top = (dom.height()-12)/2; + dom.append(""); + $rss("#rss_progressbar_div_"+domid).fadeIn(500); + } +}, +progressBarValue : function(dom,value){ + var domid = dom.prop("id"); + if($rss("#rss_progressbar_div_"+domid).length==1){ + $rss("#rss_progressbar_"+domid).animate({"width":value+"%"},100); + + } +}, +progressBarClose : function(dom){ + var domid = dom.prop("id"); + $rss("#rss_progressbar_div_"+domid).fadeOut(500,function(){$(this).remove();}); +}, +getInternetExplorerVersion: function(){ + var rv = -1; // Return value assumes failure. + if (navigator.appName == 'Microsoft Internet Explorer') + { + var ua = navigator.userAgent; + var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); + if (re.exec(ua) != null) + rv = parseFloat( RegExp.$1 ); + } + return rv; + } +} +$ = jQuery.noConflict(); diff --git a/app/assets/javascripts/upload.js b/app/assets/javascripts/upload.js new file mode 100755 index 0000000..9ac09f2 --- /dev/null +++ b/app/assets/javascripts/upload.js @@ -0,0 +1,39 @@ +//https://github.com/blueimp/jQuery-File-Upload + +$(function () { + + 'use strict'; + // Initialize the jQuery File Upload widget: + $('#fileupload').fileupload({ + acceptFileTypes:/(\.|\/)(jpe?g|png)$/i, + headers:{ + 'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content") + } + }); + $('#fileupload').bind("fileuploadadd",function(e,data){$(".fileupload-content").css("background-image","none");}) + // Load existing files: +/* $.getJSON($('#fileupload form').prop('action'),{albumid:pagevars['id']}, function (files) { + var fu = $('#fileupload').data('fileupload'); + fu._adjustMaxNumberOfFiles(-files.length); + fu._renderDownload(files) + .appendTo($('#fileupload .files')) + .fadeIn(function () { + // Fix for IE7 and lower: + $(this).show(); + }); + }); +*/ + // Open download dialogs via iframes, + // to prevent aborting current uploads: + $('#fileupload .files').delegate( + 'a:not([target^=_blank])', + 'click', + function (e) { + e.preventDefault(); + $('') + .prop('src', this.href) + .appendTo('body'); + } + ); + +}); \ No newline at end of file diff --git a/app/assets/stylesheets/admin/galleries.css b/app/assets/stylesheets/admin/galleries.css deleted file mode 100644 index afad32d..0000000 --- a/app/assets/stylesheets/admin/galleries.css +++ /dev/null @@ -1,4 +0,0 @@ -/* - Place all the styles related to the matching controller here. - They will automatically be included in application.css. -*/ diff --git a/app/assets/stylesheets/filter.css b/app/assets/stylesheets/filter.css new file mode 100644 index 0000000..6e76a70 --- /dev/null +++ b/app/assets/stylesheets/filter.css @@ -0,0 +1,84 @@ +/* Filter */ +#filter.open { + border-bottom: none; + padding-bottom: 10px; +} +#filter .filter-nav { + margin-bottom: 0px; +} +#filter.open .filter-nav { + margin-bottom: 10px; +} +#filter .filter-nav a { + text-decoration: none; +} +#filter .filter-nav .accordion-group { + border: none; +} +#filter .filter-nav .accordion-group.active { + background-color: #08c; + position: relative; +} +#filter .filter-nav .accordion-group.active a { + color: #FFF; +} +#filter .filter-nav .accordion-group.active:after { + display: block; + height: 0px; + width: 0px; + position: absolute; + bottom: -12px; + left: 50%; + margin-left: -5px; + content: ""; + border-style: solid; + border-width: 0 6px 6px 6px; + border-color: transparent transparent #e5e5e5 transparent; + z-index: 5 +} +#filter .filter-group { + clear: both; + border: none; + margin-bottom: 0px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -o-border-radius: 4px; + border-radius: 4px; +} +#filter .filter-group .accordion-body { + background-color: #e5e5e5; + border-radius: 3px; +} +#filter .filter-group .accordion-body .filter-clear { + padding: 4px; + border-top: 1px solid #D5D5D5; + text-align: right; + -webkit-box-shadow: inset 0px 1px 0px #ECECEC; + -moz-box-shadow: inset 0px 1px 0px #ECECEC; + -o-box-shadow: inset 0px 1px 0px #ECECEC; + box-shadow: inset 0px 1px 0px #ECECEC; +} +#filter .filter-group .accordion-body .filter-clear a { + text-decoration: none; +} +#filter .filter-group .collapse.in { +} +#filter .filter-group .accordion-inner { + padding: 8px 8px 5px; + /*margin-top: 10px;*/ +} +#filter .filter-group .accordion-inner > .btn { + margin-bottom: 3px; +} + + +/* Responsive */ +@media (max-width: 480px) { + /* Filter */ + #filter .filter-nav { + float: left; + } + #filter .accordion-inner.pagination-right { + text-align: left; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/gallery.css b/app/assets/stylesheets/gallery.css new file mode 100644 index 0000000..7be5327 --- /dev/null +++ b/app/assets/stylesheets/gallery.css @@ -0,0 +1,521 @@ +#orbit_gallery { + margin: 0; + padding: 0 0 10px; + list-style: none; +} +#orbit_gallery .rgalbum { + margin: 5px; + padding: 10px; + width: 200px; + background: #FFFFFF; + -webkit-transition-property: left, right, top; + -moz-transition-property: left, right, top; + -ms-transition-property: left, right, top; + -o-transition-property: left, right, top; + transition-property: left, right, top; +} +#orbit_gallery .rgalbum:hover { + box-shadow: 0px 0px 5px rgba(0,0,0,.2); +} +#orbit_gallery .rgalbum > a { + position: relative; + display: block; + overflow: hidden; + margin: 0 0 10px; + width: 200px; + height: 200px; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#orbit_gallery .rgalbum a img { + max-width: none; +} +#orbit_gallery .rgalbum:hover a img { + -webkit-filter: blur(2px); +} +#orbit_gallery .rgalbum > a:after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + display: block; + margin: 0; + background-color: #000000; + opacity: .0; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#orbit_gallery .rgalbum:hover a:after { + opacity: .4; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + filter: alpha(opacity=40); +} +#orbit_gallery .rgalbum a .albumname { + position: absolute; + bottom: 0; + margin: 0; + padding: 10px; + color: #F2F2F2; + text-shadow: 0px -1px 0 rgba(0,0,0,0.4); + letter-spacing: -0.5px; + font-size: 30px; + font-family: 'Playfair Display SC', sans-serif; + line-height: 28px; + z-index: 1; + opacity: .0; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#orbit_gallery .rgalbum:hover a .albumname { + opacity: 1; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#orbit_gallery .rgalbum .gallery_info { + margin: 0; + list-style: none; +} +#orbit_gallery .rgalbum .gallery_info li { + display: inline-block; + float: left; + color: #777777; + font-size: 1.2em; + line-height: 20px; + cursor: pointer; +} +#orbit_gallery .rgalbum .gallery_info li > a { + display: inline-block; + margin-left: 5px; + color: #777777; +} +#orbit_gallery .rgalbum .gallery_info li:hover > a { + color: #E41B2B; + text-decoration: none; +} +#orbit_gallery .rgalbum .gallery_info li:hover { + color: #0088CC; +} +#orbit_gallery .rgalbum .gallery_info li .icons-tag { + margin-left: 3px; +} +#orbit_gallery .rgalbum .gallery_info li.albumcateg { + float: right; + overflow: hidden; + max-width: 125px; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; +} +#orbit_gallery .rgalbum .gallery_info li.view { + overflow: hidden; + max-width: 50px; + text-overflow: ellipsis; + white-space: nowrap; +} +#orbit_gallery .rgalbum .albumtag { + display: none; + overflow: hidden; + margin: 0; +} + + +/* Gallery Body */ +.rgbody .gallery-info { + padding: 0 5px; +} +.rgbody .gallery-info h3 { + margin: 5px 0 0; + color: #333; + text-shadow: 0 1px 0 #ffffff; + font-family: 'Playfair Display SC', sans-serif; +} +.rgbody .gallery-info .muted { + font-family: 'Raleway', sans-serif; +} + +#imgholder { + margin: 0; + padding: 0 0 10px; + list-style: none; +} +#imgholder .rgalbum { + position: relative; + float: left; + margin: 5px; + padding: 5px; + width: 200px; + background: #FFFFFF; + overflow: hidden; + -webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1); + -moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1); + box-shadow: 0px 0px 5px rgba(0, 0, 0, .1); + -o-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1); + -webkit-transition-property: left, right, top; + -moz-transition-property: left, right, top; + -ms-transition-property: left, right, top; + -o-transition-property: left, right, top; + transition-property: left, right, top; +} +#imgholder .rgalbum.active { + background-color: #51a351; +} +#imgholder .rgalbum.active-single { + background-color: #F89406; +} +#imgholder .rgalbum .photo-action { + margin: 0; + list-style: none; + left: 5px; + right: 5px; + height: 0; + position: absolute; + background-color: #FFF; + bottom: 5px; + opacity: .9; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; + filter: alpha(opacity=90); + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#imgholder .rgalbum:hover .photo-action { + padding: 5px; + height: 30px; +} +#imgholder .rgalbum .photo-action li { + display: inline-block; + float: left; + color: #777; + font-size: 11px; + line-height: 30px; + cursor: pointer; + width: 33%; + text-align: center; + font-size: 1.2em; +} +#imgholder .rgalbum .photo-action a { + color: #777; + display: block; + text-decoration: none; + width: 100%; + height: 100%; +} +#imgholder .rgalbum .photo-action li:hover a { + color: #08C; +} +#imgholder .rgalbum .photo-action .icons-star { + color: #F8A900; + font-size: 1.4em; + line-height: 1.4em; +} +#imgholder .rgalbum a { + display: block; + overflow: hidden; + margin: 0; + width: 200px; + height: 200px; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -o-transition: all .2s linear; + transition: all .2s linear; +} +#imgholder .rgalbum a img { + max-width: none; +} + +#imgholder .rgalbum .check { + position: absolute; + top: 0; + right: 0; + width: 40px; + height: 40px; +} +#imgholder .rgalbum .check:after { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + color: #F2F2F2; + text-decoration: inherit; + content: "\f00c"; + line-height: 25px; + text-indent: 20px; + font-size: 1.3em; + position: absolute; + top: 0; + right: 0; + width: 0px; + height: 0px; + border-style: solid; + border-width: 0 40px 40px 0; + border-color: transparent #FFF transparent transparent; +} +#imgholder .rgalbum.active .check:after { + color: #FFF; + border-color: transparent #51a351 transparent transparent; +} +#imgholder .rgalbum.active-single .check:after { + color: #FFF; + border-color: transparent #F89406 transparent transparent; +} +#imgholder .rgalbum input[type="checkbox"] { + position: absolute; + top: 0; + right: 0; + z-index: 3; + display: block; + margin: 0; + width: 100%; + height: 100%; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); + opacity: 0; +} + +/* Page Silde */ +#view-photo-tags .phtot-tags { + margin: 0; + padding: 0; + list-style: none; +} +#view-photo-tags .phtot-tags li { + margin: 0 5px 5px 0; + white-space: nowrap; +} + +/* Dialog */ +.modal-body { + min-height: 80px; + line-height: 80px; + text-align: center; +} +.modal-body .spinning { + display: none; + position: absolute; + width: 70px; + height: 70px; + top: 50%; + left: 50%; + margin: -35px 0 0 -35px; +} + +/* File Upload */ +#upload-panel { + clear: both; +} +#upload-panel iframe { + width: 100%; + border: none; +} +#fileupload { + position: relative; + display: none; + clear: both; + overflow: hidden; + margin: 40px 0 15px; + height: 254px; + border: 1px solid #d4d4d4; + border-radius: 4px; + background-color: #FDFDFD; + /*-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset; + box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;*/ +} +#fileupload table { + margin: 0; +} +#fileupload .fileupload-buttonbar .navbar { + margin-bottom: 0; +} +#fileupload .fileupload-buttonbar .navbar .add-photo { + border: none; + border-right: 1px solid #d4d4d4; + background-color: transparent; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; +} +#fileupload .fileupload-buttonbar .navbar .add-photo:hover { + color: #333333; + text-decoration: none; + background-color: #EDEDED; +} +#fileupload .fileupload-buttonbar .navbar .fileinput-button { + position: relative; + overflow: hidden; +} +#fileupload .fileupload-buttonbar .navbar .fileinput-button input { + position: absolute; + top: 0; + right: 0; + margin: 0; + font-size: 23px; + opacity: 0; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + cursor: pointer; + -webkit-transform: translate(-300px, 0) scale(4); + -moz-transform: translate(-300px, 0) scale(4); + -ms-transform: translate(-300px, 0) scale(4); + -o-transform: translate(-300px, 0) scale(4); + transform: translate(-300px, 0) scale(4); + direction: ltr; +} +#fileupload .fileupload-buttonbar .navbar-inner { + border-width: 0 0 1px; + border-radius: 4px 4px 0 0; + padding: 0; +} + +#fileupload .fileupload-progress .progress { + position: absolute; + right: 0; + left: 0; + margin-bottom: 0; + height: 5px; + border-radius: 0; + background-color: transparent; + background-image: none; +} +#fileupload .fileupload-progress .progress-success.progress-striped .bar { + background-color: #0088CC; +} +#fileupload .fileupload-progress .progress-extended { + position: absolute; + top: 1px; + right: 0; + padding-right: 15px; + color: #0088CC; + text-align: right; + text-shadow: 0 1px 0 #ffffff; + letter-spacing: -0.1em; + font-size: 12px; + font-family: 'Varela Round', sans-serif; + line-height: 40px; +} +#fileupload .fileupload-buttonbar { + position: relative; + z-index: 3; +} +#fileupload #dropzone { + margin: 15px 10px 10px; + padding: 30px; + text-align: center; + font-size: 2em; + font-family: 'Raleway'; + line-height: 1.2em; + color: #e4e4e4; +} +#fileupload #dropzone div[data-icons] { + font-size: 4em; + height: 70px; + padding-top: 30px; + text-shadow: 0px -1px 0px #ececec; + color: #f5f5f5; +} +#fileupload #dropzone.drop { + position: absolute; + top: 37px; + left: 0; + right: 0; + bottom: 0; + border: 2px dashed #0088CC; + border-radius: 10px; + color: #0088CC; + background-color: #FFFFFF; + z-index: 0; +} +#fileupload #dropzone.fade { + opacity: .3; +} +#fileupload #dropzone.in { + opacity: .7; + z-index: 2; + border-color: #faa732; + color: #faa732; +} +#fileupload #dropzone.drop div[data-icons] { + text-shadow: 0px -1px 0px #0c5f80; + color: #0088CC; +} +#fileupload #dropzone.in div[data-icons] { + text-shadow: 0px -1px 0px #a28a10; + color: #faa732; +} +#fileupload #file-list { + position: relative; + z-index: 1; + height: 209px; + margin: 2px 0; +} +#fileupload #file-list .pane { + margin-right: 2px; +} +#fileupload #file-list .files { + margin: 0; + padding: 10px 14px 10px 10px; + list-style: none; +} +#fileupload #file-list .files > li { + padding: 10px; +} +#fileupload #file-list .files > li:nth-child(even) { + background-color: #e9e9e9; + border-radius: 3px; +} +#fileupload #file-list .files ul { + position: relative; + margin: 0; + padding: 0; + list-style: none; +} +#fileupload #file-list .files ul li { + float: left; +} +#fileupload #file-list .files ul li.action-bnt { + float: right; +} +#fileupload #file-list .preview { + width: 80px; + min-height: 1px; + margin-right: 10px; + text-align: center; +} +#fileupload #file-list .name { + width: 150px; + max-width: 250px; + margin-left: 15px; +} +#fileupload #file-list .progress { + position: absolute; + left: -5px; + right: -5px; + bottom: -5px; + margin-bottom: 0; + height: 5px; + box-shadow: none; + background-color: transparent; + background-image: none; +} +#fileupload #file-list .size { + width: 80px; +} +#fileupload #file-list .action-bnt { + text-align: right; +} \ No newline at end of file diff --git a/app/assets/stylesheets/gallery/.keep b/app/assets/stylesheets/gallery/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/gallery_frontend.css b/app/assets/stylesheets/gallery_frontend.css new file mode 100644 index 0000000..c8cbef8 --- /dev/null +++ b/app/assets/stylesheets/gallery_frontend.css @@ -0,0 +1,332 @@ +.rg, .rgp { + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; +} +.rg input, .rgp input, .rg textarea, .rgp textarea { + resize: none; + margin: 0; + display: block; + font-size: 13px; + } +.rgp textarea { overflow: auto; } +.rg a, .rgp a { + text-decoration: none; + outline: none; + } +.rg a:hover { } + +/*.rg img { display: block; border: none; }*/ + +.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; } + +.rgui { + display: inline-block; + cursor: pointer; + } +.rghead, .rgbody { overflow: hidden; } +.rghead { + padding: 10px 0; + } +.rgtitle { + color: #333; + text-shadow: 0 1px 0 #ddd; + font-size: 2em; + padding: 0 8px; + } +.rgbody { + + } +.rgfn { overflow: hidden; } +.rgalbum, .rgphoto { float: left; margin: 0 10px 24px 0; } +.rgalbum { + margin: 0 16px 16px 0; + padding: 6px; + width: 138px; + height: 220px; + border: solid 1px #ccc; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; +} +.rgalbum > a { + display: block; + float: none; + margin: -6px -6px 0 -6px; +} +.rgalbum img { + transition: all, 0.5s ease; + -webkit-transition: all, 0.5s ease; + -moz-transition: all 0.5s ease; + -ms-transition: all, 0.5s ease; + } +.rgphoto { } +.rgphoto a { + display: block; + + transition: all, 0.3s ease; + -webkit-transition: all, 0.3s ease; + -moz-transition: all, 0.3s ease; +} +.rgphoto a:hover img { + opacity: 0.85; +} +.rgphoto img, .rgphoto_edit img { + /*display: block;*/ + + transition: all, 0.3s ease; + -webkit-transition: all, 0.3s ease; + -moz-transition: all, 0.3s ease; + } +.rgalbum .albumname { + font-size: 1.25em; + /*line-height: ;*/ + margin: 6px 0; + display: block; + height: 45px; + overflow: hidden; + transition: background 0.3s ease; + -webkit-transition: background 0.3s ease; + -moz-transition: background 0.3s ease; + -ms-transition: background 0.3s ease; + } +.rgalbum a:hover img { + opacity: 0.85; + } +.rgalbum .categoryname {} +.rgalbum .tagnames { + display: block; + margin-top: 8px; + padding-top: 8px; + line-height: 22px; + height: 22px; + overflow: hidden; + border-top: solid 1px #ccc; + color: #666; +} + +.taglist { + padding: 10px 0; +} +.taglist_title { + font-size: 1.5em; + margin: 0 0 10px 0; +} +.taglist ul { + padding: 10px 0; + border-top: solid 1px #ddd; + overflow: hidden; +} +.taglist li { + float: left; + margin: 0 8px 8px 0; +} + +.rgp .rgtitle { margin: 0 0 10px 0; } + + +/* Ruling Slide */ +.rslide { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + background: #222; + clear: both; + /*z-index: 99;*/ + min-height: 250px; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + } +.rslide.fullscreen { position: fixed; z-index: 99; } +.rslide.fullscreen .comp img{ + width: auto; +} +.rslideinside { + } +.comp { + width: 100%; + height: auto; + overflow: hidden; + position: relative; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + } +.comp img{ display: block; width: 100%; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; } +.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; } +.rslidenav { + position: absolute; + top: 50%; + left: 0; + right: 0; + margin-top: -35px; + } +.rslidenav a { + position: absolute; + display: block; + width: 30px; + height: 40px; + overflow: hidden; + text-indent: -999px; + background: #000 0 center url(../../../assets/gallery/slidenav.png) no-repeat; + background: rgba(0,0,0,0.9) 0 0 url(../../../assets/gallery/slidenav.png) no-repeat; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -ms-transition: all 0.3s ease; + } +.rslidenav a:hover { + background-color: #fff; + background-color: rgba(255,255,255,0.9); + } +.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; } +.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; } +.rslidenav a.navP:hover { background-position: -30px -40px; } +.rslidenav a.navN:hover { background-position: 0 0; } +.slidectrl { + position: absolute; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 30px; + background: #000 left top url(../../../assets/gallery/slidetitlebg.png) repeat-x; + background: rgba(0,0,0,0.9) left top url(../../../assets/gallery/slidetitlebg.png) repeat-x; + /*z-index: 999;*/ + } +.slidectrl a { + display: block; + float: right; + text-indent: -9999px; + overflow: hidden; + width: 30px; + height: 30px; + background: transparent 0 0 url(../../../assets/gallery/slideui.gif) no-repeat; + border-left: solid 1px #222; + } +.slidectrl a.togglelist { background-position: 0 -30px; } +.slidectrl a.togglescreen { background-position: 0 -90px; } +.slidectrl a.toinline { background-position: -30px 0; } +.slidectrl a.sharebt { background-position: -30px -30px; } +.slidectrl a.browserfullscreen { display:none;} +.slidectrl a.slidestop { background-position: 0 -60px; } +.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; } +.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; } +.browserFullScreen .togglescreen { display: none; } +.slideinfo { + height: 30px; + line-height: 30px; + color: #fff; + font-size: 13px; + overflow: hidden; + } +.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; } +.slideinfo span.info { color: #ccc; text-transform: none; } + +.slidelist { + position: absolute; + bottom: 30px; + z-index: 98; + width: 100%; + height: 0; + overflow: auto; + overflow-x: hidden; + background: transparent 0 0 url(../../../assets/gallery/slidelistbg.png); + } +.slidelist ul { + margin: 0 auto; + padding: 10px 0 10px 10px; + list-style: none; + } +.slidelist li { + display: inline-block; + margin: 0 10px 10px 0; + } +.slidelist a { + border: solid 2px #fff; + display: block; + width: 120px; + height: 96px; + position: relative; + + box-shadow: 0 0 6px rgba(0,0,0,0.7); + -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7); + -moz-box-shadow: 0 0 6px rgba(0,0,0,0.7); + -ms-box-shadow: 0 0 6px rgba(0,0,0,0.7); + } +.slidelist a.playall { + border: none; + width: 80px; + height: 32px; + margin: 31px 0 0 22px; + background: transparent 0 0 url(../../../assets/gallery/playall.png) no-repeat; + + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + -ms-box-shadow: none; + } +.slidelist a.playall:hover { background-position: 0 -32px; } +#li_play_all { width: 124px; height: 94px; } +.slidelist img { + margin: 0; + background: #fff; + display: block; + + transition: all 0.2s ease; + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + -ms-transition: all 0.2s ease; + } +.slidelist a:hover img { + padding: 4px; + margin: -4px; + } + +.dm { + background: #fff; + border: solid 1px #a4a4a4; + border-right-color: #666; + position: absolute; + overflow: hidden; + padding: 2px 0; + display: none; + + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + } +.dm ul { margin: 0; padding: 0; list-style: none !important; } +.dm li { + margin: 0; + padding: 0; + border-bottom: solid 1px #ccc; + list-style: none !important; + } +.dm li a { + display: block; + padding: 6px 10px; + font-size: 13px; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -ms-transition: all 0.3s ease; + } +.dm li a:hover { background: #eee; } + + + +/* orbit style implementation */ +#orbit_gallery { + margin: 0 -10px 30px -10px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/gallery_old.css b/app/assets/stylesheets/gallery_old.css new file mode 100755 index 0000000..a3a2cb5 --- /dev/null +++ b/app/assets/stylesheets/gallery_old.css @@ -0,0 +1,564 @@ +.rg, .rgp { + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; +} +.rg input, .rgp input, .rg textarea, .rgp textarea { + resize: none; + margin: 0; + display: block; + font-size: 13px; + } +.rgp textarea { overflow: auto; } +.rg a, .rgp a { + text-decoration: none; + outline: none; + } +.rg a:hover { } + +/*.rg img { display: block; border: none;}*/ + +.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; } + +.rgui { + display: inline-block; + cursor: pointer; + } +.rghead, .rgbody { overflow: hidden; } +.rghead { + border-bottom: solid 1px #ccc; + padding: 10px 0; + background: #fff; + } +.rgtitle { + color: #333; + text-shadow: 0 1px 0 #ddd; + font-size: 2em; + padding: 0 8px; + } +.rgbody { + + } +.rgfn { overflow: hidden; padding: 4px 10px; } +.rgalbum, .rgphoto { float: left; margin: 0 10px 24px 0; } +.rgalbum { + padding: 16px; + margin: 0 8px 8px 0; + border: solid 1px #ccc; + width: 300px; + height: 120px; + border-radius: 4px; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; +} +.rgalbum > a { + display: block; + float: left; + margin-right: 10px; +} +.rgalbum:hover { + box-shadow: 0 0 6px rgba(0,0,0,0.2); +} +.rgalbum img { + transition: all, 0.5s ease; + -webkit-transition: all, 0.5s ease; + -moz-transition: all 0.5s ease; + -ms-transition: all, 0.5s ease; + } +.rgphoto { } +.rgphoto a { + display: block; + padding: 4px; + border: solid 1px #ddd; + background-color: #fff; + border-radius: 4px; + transition: all, 0.3s ease; + -webkit-transition: all, 0.3s ease; + -moz-transition: all, 0.3s ease; +} +.rgphoto a:hover { + border-color: #999; + box-shadow: 0 3px 6px rgba(0,0,0,0.2); +} +.rgphoto img, .rgphoto_edit img { + /*display: block;*/ + border-radius: 3px; + transition: all, 0.3s ease; + -webkit-transition: all, 0.3s ease; + -moz-transition: all, 0.3s ease; + } +.rgalbum .albumname { + font-size: 18px; + padding: 6px 0; + display: block; + transition: background 0.3s ease; + -webkit-transition: background 0.3s ease; + -moz-transition: background 0.3s ease; + -ms-transition: background 0.3s ease; + } +.rgalbum a:hover img { + opacity: 0.85; + } + +.rgp .rgtitle { margin: 0 0 10px 0; } + +/* Photo Edit */ +.albumname_edit label, .albumname_edit .rginput, .rgphoto_edit > a, .rgphoto_edit .rginput { float: left; } +.rgphoto_edit, .albumname_edit { + clear: both; + overflow: hidden; + margin-bottom: 10px; +} +.albumname_edit label { + width: 150px; + margin: 0 10px 0 0; + text-align: right; + padding: 0; + line-height: 24px; +} +.albumname_edit .rginput { } +.rgphoto_edit img { margin: 0 10px 10px 0; } +.rgphoto_edit .rginput { margin-right: 10px; } +.rgphoto_edit .edit_fn { float: left; margin-bottom: 10px; } +.rgphoto_edit .edit_fn .bt-dels { } + +/* Delete List */ +.rglist { overflow: hidden; padding: 10px 0; } +.list { table-layout:fixed; width: 100%; margin: 0 0 12px 0; } +.list thead th { padding: 8px 4px; font-size: 30px; font-weight: bold; } +.list th img { width: 60px; height: 45px; } +.list .photoname { padding-left: 6px; } +.list .photofn { padding-right: 4px; } +.list .photofn a { float: right; margin-left: 4px; display: block; } +.list th { padding: 4px 0 4px 4px; } +.list tbody th, .list tbody td { border-bottom: solid 1px #ccc; } +.list .odd th, .list .odd td { background: #f6f6f6; } +.list .c1 { width: 64px; } +.list .c3 { width: 40px; } + +/* Ruling Slide */ +.rslide { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + background: #222; + clear: both; + /*z-index: 99;*/ + min-height: 250px; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + } +.rslide.fullscreen { position: fixed; z-index: 99; } +.rslideinside { + /* + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + */ + } +.comp { + width: 100%; + height: auto; + overflow: hidden; + position: relative; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + } +.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; } +.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; } +.rslidenav { + position: absolute; + top: 50%; + left: 0; + right: 0; + margin-top: -35px; + } +.rslidenav a { + position: absolute; + display: block; + width: 30px; + height: 40px; + overflow: hidden; + text-indent: -999px; + background: #000 0 center url(../../../assets/gallery/slidenav.png) no-repeat; + background: rgba(0,0,0,0.9) 0 0 url(../../../assets/gallery/slidenav.png) no-repeat; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -ms-transition: all 0.3s ease; + } +.rslidenav a:hover { + background-color: #fff; + background-color: rgba(255,255,255,0.9); + } +.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; } +.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; } +.rslidenav a.navP:hover { background-position: -30px -40px; } +.rslidenav a.navN:hover { background-position: 0 0; } +.slidectrl { + position: absolute; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 30px; + background: #000 left top url(../../../assets/gallery/slidetitlebg.png) repeat-x; + background: rgba(0,0,0,0.9) left top url(../../../assets/gallery/slidetitlebg.png) repeat-x; + /*z-index: 999;*/ + } +.slidectrl a { + display: block; + float: right; + text-indent: -9999px; + overflow: hidden; + width: 30px; + height: 30px; + background: transparent 0 0 url(../../../assets/gallery/slideui.gif) no-repeat; + border-left: solid 1px #222; + } +.slidectrl a.togglelist { background-position: 0 -30px; } +.slidectrl a.togglescreen { background-position: 0 -90px; } +.slidectrl a.toinline { background-position: -30px 0; } +.slidectrl a.sharebt { background-position: -30px -30px; } +.slidectrl a.browserfullscreen { display:none;} +.slidectrl a.slidestop { background-position: 0 -60px; } +.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; } +.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; } +.browserFullScreen .togglescreen { display: none; } +.slideinfo { + height: 30px; + line-height: 30px; + color: #fff; + font-size: 13px; + overflow: hidden; + } +.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; } +.slideinfo span.info { color: #ccc; text-transform: none; } + +.slidelist { + position: absolute; + bottom: 30px; + z-index: 99; + width: 100%; + height: 0; + overflow: auto; + overflow-x: hidden; + background: transparent 0 0 url(../../../assets/gallery/slidelistbg.png); + } +.slidelist ul { + margin: 0 auto; + padding: 10px 0 10px 10px; + list-style: none; + } +.slidelist li { + display: inline-block; + margin: 0 10px 10px 0; + } +.slidelist a { + border: solid 2px #fff; + display: block; + width: 150px; + height: 120px; + position: relative; + + box-shadow: 0 0 6px rgba(0,0,0,0.7); + -webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7); + -moz-box-shadow: 0 0 6px rgba(0,0,0,0.7); + -ms-box-shadow: 0 0 6px rgba(0,0,0,0.7); + } +.slidelist a.playall { + border: none; + width: 80px; + height: 32px; + margin: 31px 0 0 22px; + background: transparent 0 0 url(../../../assets/gallery/playall.png) no-repeat; + + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + -ms-box-shadow: none; + } +.slidelist a.playall:hover { background-position: 0 -32px; } +#li_play_all { width: 124px; height: 94px; } +.slidelist img { + margin: 0; + background: #fff; + display: block; + + transition: all 0.2s ease; + -webkit-transition: all 0.2s ease; + -moz-transition: all 0.2s ease; + -ms-transition: all 0.2s ease; + } +.slidelist a:hover img { + padding: 4px; + margin: -4px; + } + +.dm { + background: #fff; + border: solid 1px #a4a4a4; + border-right-color: #666; + position: absolute; + overflow: hidden; + padding: 2px 0; + display: none; + + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -ms-border-radius: 4px; + } +.dm ul { margin: 0; padding: 0; list-style: none !important; } +.dm li { + margin: 0; + padding: 0; + border-bottom: solid 1px #ccc; + list-style: none !important; + } +.dm li a { + display: block; + padding: 6px 10px; + font-size: 13px; + + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -ms-transition: all 0.3s ease; + } +.dm li a:hover { background: #eee; } + +/* Ruling Gallery UI */ +.rgbt { + padding: 0 0 0 32px; + vertical-align: top; + + text-shadow: 0 1px 0 #fff; + -webkit-text-shadow: 0 1px 0 #fff; + -moz-text-shadow: 0 1px 0 #fff; + -ms-text-shadow: 0 1px 0 #fff; + } +.rgbt span { + padding: 0 12px 0 8px; + display: inline-block; + line-height: 30px; + height: 32px; + font-size: 14px; + } + +.rgbtsg { + padding: 6px; + } +.rgphoto_edit .rgbtsg.active { display: inline-block; } +.bt-finish { display: block; float: right; clear: both; } +.bt-addnew { + margin: 0 auto; + width: 98px; + height: 100px; + display: block; + } +.bt-next{ + background-position: 0 -258px; + display: block; + float: right; + clear: both; + } +.bt-next:hover { background-position: 0 -448px; } +.bt-next:active { background-position: 0 -638px; } +.bt-close { + position: absolute; + right: 6px; + top: 6px; + } + + +.inputui { + margin: 0 0 8px 0; + } +.inputui span { + padding: 0 4px 0 0; + display: block; + } +.rginput { max-width: 400px; } +.rginput input, .rginput textarea { color: #999; } +.rginput.focus input, .rginput.focus textarea { color: #333; } + +.rgih26 { width: 208px; } +.rgih26 span { } +.rgih26 input { width: 356px; } +.rgih26.focus { } +.rgih26.focus span { } +.rgih68 { width: 396px; } +.rgih68 span { padding: 3px 4px 3px 0; } +.rgih68 textarea { width: 392px; height: 62px; } +.rgih68.focus { } +.rgih68.focus span { } +.rgih98 { width: 396px; } +.rgih98 span { } +.rgih98 textarea { width: 356px; height: 110px; } +.rgih98.focus { } +.rgih98.focus span { } + +.w380 { width: 386px; } + +#imgholder { overflow: hidden; } + +/* upload panel */ +#upload_panel_holder { + display: none; + margin: 16px 0 0 0; + clear: both; + float: right; + width: 100%; +} +#upload_panel { + background-color: #ddd; +} + +/* tag panel */ +#tag_panel { + position: fixed; + right: -200px; + top: 31px; + width: 200px; + min-height: 100px; + border-left: solid 1px #ccc; + background-color: #fff; +} +#tag_panel .scrollbar { + right: 0px; + top: 0px; + width: 9px; +} +#tag_panel .viewport { + height: 100%; +} + +.tag_list { + margin: 0; + padding: 0; +} +.tag_list li { + padding: 4px 6px; + border-top: solid 1px #f6f6f6; +} +.tag_list li:first-child { + border: 0; +} +.tag_list li:hover { + background-color: #08c; +} +.tag_list li:hover label { + color: #fff; +} +.tag_list input[type=checkbox], .tag_list label { + display: inline-block; + vertical-align: middle; + text-transform: capitalize; + margin: 0; +} +.tag_list label { + padding: 0 6px; +} +.tag_search { + position: absolute; + left: -1px; + bottom: -30px; + width: 200px; + height: 32px; + background-color: #f5f5f5; + border-left: solid 1px #ccc; + border-top: solid 1px #ddd; +} +.tag_search input[type=text] { + box-shadow: none; + width: 92px; + height: 25px; + line-height: 25px; + padding: 3px 6px 3px 24px; + border: 0; + border-top: solid 1px #fff; +} +.tag_search input[type=text]:focus { + background-color: #fff; +} +.tag_search .icon-search { + position: absolute; + left: 6px; + top: 50%; + margin-top: -7px; +} +#tag_panel .tag_save { + position: absolute; + right: 0; + bottom: 0; + height: 31px; + border-left: solid 1px #ccc; + background-color: #fff; + padding: 2px 4px 0 4px; +} + + +/* orbit style implementation */ +#orbit_gallery { + margin-bottom: 30px; +} +#orbit_gallery .nav-tabs, #orbit_gallery .tab-pane { + margin-left: 8px; + margin-right: 8px; +} +.tab_content .tab-pane{ + display: none; +} +.tab_content .active{ + display: block; +} +#orbit_gallery .btn { margin: 0; } +#orbit_gallery .btn i { margin-right: 4px; } +#orbit_gallery .rgfn .btn { + margin-left: 8px; +} +#orbit_gallery .form-actions { background-color: whiteSmoke; } + +.o_gallery .tagnames { + display: block; + margin-top: 6px; +} +.o_gallery .label-tags { + display: inline-block; + margin: 0 6px 6px 0; +} + +.o_gallery .rgbody, .o_album .rgbody { + padding: 10px 8px; +} + +#categories .add-album .control-label { + text-align: left; + width: 100px; + padding-left: 12px; + padding-right: 12px; +} +.o_album_edit form { + margin-left: 8px; +} + +#loading{ + background: #fff 0 center url("../../../assets/loading.gif") no-repeat; + height: 16px; + margin: auto; + width: 220px; +} diff --git a/app/assets/stylesheets/jquery-ui.css b/app/assets/stylesheets/jquery-ui.css new file mode 100644 index 0000000..759a187 --- /dev/null +++ b/app/assets/stylesheets/jquery-ui.css @@ -0,0 +1,566 @@ +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,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:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.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%; } +/* + * jQuery UI Accordion 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.16 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.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 */ +/* + * jQuery UI Datepicker 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.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 { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + 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*/ +}/* + * jQuery UI Dialog 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; 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; } +/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* + * jQuery UI Resizable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; 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;}/* + * jQuery UI Selectable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Slider 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.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; }/* + * jQuery UI Tabs 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.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: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; 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-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected 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-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/ + */ + + +/* 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(images/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(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(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: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(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 { 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(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; } +.ui-widget :active { outline: 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(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(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; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(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-off { background-position: -96px -144px; } +.ui-icon-radio-on { 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(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/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}*/; } \ No newline at end of file diff --git a/app/assets/stylesheets/jquery.fileupload-ui.css b/app/assets/stylesheets/jquery.fileupload-ui.css new file mode 100755 index 0000000..7d538c8 --- /dev/null +++ b/app/assets/stylesheets/jquery.fileupload-ui.css @@ -0,0 +1,168 @@ +@charset 'UTF-8'; +/* + * jQuery File Upload UI Plugin CSS 5.0.6 + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://creativecommons.org/licenses/MIT/ + */ +body { margin: 0; } +#fileupload { position: relative; } +#fileupload form { margin: 0; } +.fileupload-buttonbar .ui-button input { + position: absolute; + top: 0; + right: 0; + margin: 0; + border: solid transparent; + border-width: 0 0 100px 200px; + opacity: 0; + filter: alpha(opacity=0); + -o-transform: translate(250px, -50px) scale(1); + -moz-transform: translate(-300px, 0) scale(4); + direction: ltr; + cursor: pointer; +} + +.fileinput-button { + overflow: hidden; +} + +/* Fix for IE 6: */ +/**html .fileinput-button { + padding: 2px 0; +}*/ + +/* Fix for IE 7: */ +/**+html .fileinput-button { + padding: 2px 0; +}*/ + +.fileupload-buttonbar { + height: 44px; + border-bottom: none; + background: transparent 0 0 url(../../../assets/gallery/uppt.png) repeat-x; + position: relative; + z-index: 9; + } + +.fileupload-buttonbar .ui-button { + vertical-align: middle; + font-size: 13px; + font-family: mako; + border: none; + margin: 0; + padding: 0; + background: none; + } +.fileupload-buttonbar .ui-button .ui-button-text { + height: 40px; + line-height: 40px; + padding: 0 14px 0 26px; + background: transparent right center url(../../../assets/gallery/upsep.png) no-repeat; + text-shadow: 1px 1px 0 #fff; + } + +.fileupload-content { + border-top-width: 0; + height: 250px; + overflow: auto; + overflow-x:hidden; + background: #FAFAFA center center url(../../../assets/gallery/uploadbg.gif) no-repeat; + position: relative; + margin-top: -2px; + z-index: 2; + } + +.fileupload-content .ui-progressbar { + width: auto; + height: 18px; + } + +.fileupload-content .ui-progressbar-value { + background: url(../../../assets/gallery/pbar-ani.gif); + height: 16px; + margin: 0; + border-left: none; + border-right: none; + border-radius: 6px; + } +.files .ui-progressbar-value { border: none; height: 18px; border-radius: 2px; } +.fileupload-content .fileupload-progressbar { + width: 400px; + margin: -20px 0 0 -202px; + padding: 2px; + background: rgba(0,0,0,0.8); + position: fixed; + top: 50%; + left: 50%; + border: 0; + border-radius: 4px; + box-shadow: 0 2px 3px rgba(0,0,0,0.4); + -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.4); + -moz-box-shadow: 0 2px 3px rgba(0,0,0,0.4); + -ms-box-shadow: 0 2px 3px rgba(0,0,0,0.4); + } + +.files { + margin: 0; + border-collapse: collapse; + width: 100%; + table-layout:fixed; + font-family: mako; +} + +.files td { + padding: 5px 4px; + border-spacing: 0; + font-size: 13px; + } + +.files img { border: none; width: 80px; } + +.files .name { } + +.files .size { + text-align: right; + white-space: nowrap; + width: 100px; + } +.files .preview { width: 88px; } +/*.files .progress { width: ; }*/ +.files .start { width: 40px; } +.files .cancel { width: 40px; } + +.ui-state-disabled .ui-state-disabled { + opacity: 1; + filter: alpha(opacity=100); +} + +.ui-state-disabled input { + cursor: default; +} +.fileupload-buttonbar .ui-icon { + background: transparent center 0 url(../../../assets/gallery/upicon.png) no-repeat; + height: 16px; + margin: 0; + padding: 12px 0; + top: 0; + } +.ui-icon.ui-icon-plusthick {} +.ui-button:hover .ui-icon.ui-icon-plusthick { background-position: center -40px; } +.ui-icon.ui-icon-circle-arrow-e { background-position: center -80px; } +.ui-button:hover .ui-icon.ui-icon-circle-arrow-e { background-position: center -120px; } +.ui-icon.ui-icon-cancel { background-position: center -160px; } +.ui-button:hover .ui-icon.ui-icon-cancel { background-position: center -200px; } +.ui-icon.ui-icon-trash { background-position: center -240px; } +.ui-button:hover .ui-icon.ui-icon-trash { background-position: center -280px; } + +.files .ui-icon { background: transparent center 0 url(../../../assets/gallery/upicon.png) no-repeat; } +.files .ui-icon.ui-icon-circle-arrow-e { background-position: center -91px; } +.files .ui-button:hover .ui-icon.ui-icon-circle-arrow-e { background-position: center -131px; } +.files .ui-icon.ui-icon-cancel { background-position: center -171px; } +.files .ui-button:hover .ui-icon.ui-icon-cancel { background-position: center -211px; } +.files .ui-icon.ui-icon-trash { background-position: center -251px; } +.files .ui-button:hover .ui-icon.ui-icon-trash { background-position: center -291px; } \ No newline at end of file diff --git a/app/assets/stylesheets/widget_gallery.css b/app/assets/stylesheets/widget_gallery.css new file mode 100644 index 0000000..dd9f959 --- /dev/null +++ b/app/assets/stylesheets/widget_gallery.css @@ -0,0 +1,70 @@ +.widget_gallery { + margin-bottom: 20px; +} +.widget_gallery:after { + display: table; + width: 100%; + content: ''; +} +.widget_gallery ul { + list-style: none; + margin: 0; + padding: 0; +} +.widget_gallery li a { + display: block; +} +.widget_gallery li a img { + height: auto; + display: block; +} + +/* widget 1 */ +.w1 ul { + margin: 0 -1%; +} +.w1 li { + float: left; + margin: 1%; +} +.w1.c2 li { width: 48%; } +.w1.c3 li { width: 31.3333%; } +.w1.c4 li { width: 23%; } +.w1.c5 li { width: 18%; } +.w1.c6 li { width: 14.6666%; } +.w1 li a { + -webkit-transition: opacity 0.3s ease; + -moz-transition: opacity 0.3s ease; + transition: opacity 0.3s ease; +} +.w1 li a:hover { + opacity: 0.8; + position: relative; +} +.w1 li a img { + width: 100%; +} + +/* widget 2 */ +.w2 li { + width: 100%; +} +.w2 li a img { + width: 100%; + height: auto; +} +.w2 li a { + position: relative; + overflow: hidden; + color: #fff; + text-transform: capitalize; +} +.w2 li a .desc { + position: absolute; + bottom: -60px; + opacity: 0; + display: block; + width: 100%; + padding: 5%; + background-color: rgba(8, 166, 255, 0.8); +} \ No newline at end of file diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index 69eb5e0..f72f7ea 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -1,4 +1,228 @@ -class Admin::GalleriesController < ApplicationController +class Admin::GalleriesController < OrbitAdminController + before_filter :setup_vars def index + @albums = Album.all + @tags = @module_app.tags + end + + def show + @album = Album.find(params[:id]) + @images = @album.album_images + @image_content = [] + @images.each do |image| + @image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}} + end + @tags = @module_app.tags + respond_to do |h| + h.html + h.json {render json: @image_content} + end + end + + def new + @album = Album.new + @tags = @module_app.tags + @categories = @module_app.categories + end + + def create + album = Album.new(album_params) + album.save! + redirect_to admin_galleries_path + end + + + + def destroy + album = Album.find(params[:id]) + album.destroy + redirect_to admin_galleries_path + + end + + def edit + @album = Album.find(params[:id]) + @tags = @module_app.tags + @categories = @module_app.categories + + end + + def set_cover + if params[:set_cover] == "true" + album = Album.find(params[:album_id]) + image = AlbumImage.find(params[:image_id]) + album.update_attributes({:cover_path => image.file.thumb.url, :cover=>params[:image_id]}) + else + album = Album.find(params[:album_id]) + album.update_attributes({:cover_path => nil, :cover=>"default"}) + end + render :json =>{"success"=>true}.to_json + end + + def get_album_json + albums = Album.all + output = Array.new + + albums.each do |album| + tag_names = Array.new + + album.tag_ids.each do |tag| + tag_names << get_tags.include?(tag) + end + if album.cover_path + cover_path = album.cover_path + else + cover_path = "/assets/gallery/default.jpg" + end + output << { + album_cover_file: "http://#{request.host_with_port}"+cover_path, + album_name: album.name, + album_tag_names: tag_names, + album_link:"http://#{request.host_with_port}#{panel_gallery_back_end_album_get_imgs_json_path(album)}", + } + end + + render :json=>JSON.pretty_generate(output) + end + + def get_imgs_json + album = Album.find(params[:album_id]) + images = album.album_images.all + output = Array.new + + images.each do |image| + tags = Array.new + + image.tag_ids.each do |tag| + tags << get_tags.include?(tag) + end + + if image.file.theater.present? + @image_file = image.file.theater.url + else + @image_file = image.file.url + end + + output << { + image_title: image.title, + image_description: image.description, + image_file: { url: "http://#{request.host_with_port}#{@image_file}", + thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"}, + image_tag_names: tags} + end + + render :json=>JSON.pretty_generate(output) + end + + def imgs + @album = Album.find(params[:gallery_id]) + @tag_names = Array.new + @images = @album.album_images.all + @output = Array.new + @images.each do |values| + @output << { _id: values.id.to_s, + theater_link: admin_image_path(values), + description: values.description, + title: values.title, + file: values.file.as_json[:file], + gallery_album_id: values.album_id, + tags: values.tags} + end + render :json=>{"images" => @output, "tags" => @album.tags}.to_json + end + + + + def upload_image + @album = Album.find(params[:album_id]) + @files = params['files'] + a = Array.new + @files.each do |file| + @image = @album.album_images.new + @image.file = file + @image.tags = @album.tags rescue [] + @image.save! + a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>admin_image_path(@image)} + end + render :json=>{"files"=>a}.to_json + end + + def new_images + + if params[:last_image_id] != "" + @lastimage = AlbumImage.find(params[:last_image_id]) + @album = Album.find(params[:album_id]) + @newimages = @album.album_images.where(:created_at.gt => @lastimage.created_at) + else + @album = Album.find(params[:album_id]) + @newimages = @album.album_images + end + + render :layout=>false + end + + + def images_tags + album = Album.find(params[:album_id]) + tags = Array.new + images = album.album_images.all + images.each do |image| + tags << {"id"=>image.id, "tags" => image.tags} + end + render :json=>tags.to_json + end + + def update + @album = Album.find(params[:id]) + tagsToDestroy = [] + tagsToAdd = [] + new_tags = params[:album][:tags] || [] + old_tags = @album.tags.collect{|t| t.id.to_s} + old_tags.each do |tag| + if !new_tags.include?(tag) + tagsToDestroy << tag + end + end + if new_tags != nil + new_tags.each do |tag| + if !old_tags.include?(tag) + tagsToAdd << tag + end + end + end + update_children_image_tag(tagsToDestroy,tagsToAdd) + @album.update_attributes(album_params) + redirect_to admin_gallery_path(@album) + end + + def update_children_image_tag(tagsToDestroy,tagsToAdd) + # tagsToDestroy will contain all tag ids which have to be deleted from the galley_images + # tagsToAdd will contain all tag ids which ve to be added in tall album_images + @images = AlbumImage.all + @images.each do |image| + image_tags = image.tags.collect{|t| t.id.to_s} + tagsToAdd.each do |tag| + image_tags << tag + end + tagsToDestroy.each do |tag| + if image_tags.include?tag + image_tags.delete(tag) + end + end + image.tags = image_tags + image.save + end + end + + private + + def setup_vars + @module_app = ModuleApp.where(:key=>"gallery").first + end + + def album_params + p = params.require(:album).permit! + p["tags"] = p["tags"] || [] + p end end diff --git a/app/controllers/admin/images_controller.rb b/app/controllers/admin/images_controller.rb new file mode 100644 index 0000000..761704b --- /dev/null +++ b/app/controllers/admin/images_controller.rb @@ -0,0 +1,64 @@ +class Admin::ImagesController < ApplicationController + before_filter :setup_vars + def show + @image = AlbumImage.find(params[:id]) + @albumid = @image.album_id + @album = Album.find(@albumid) + @images = @album.album_images.all + end + + def delete_photos + images = params['images'] + images.each do |image| + img = AlbumImage.find(image) + img.delete + end + if params['delete_cover'] == "true" + album = Album.find(params['album_id']) + album.update_attributes(:cover=>"default",:cover_path => nil) + end + render :json =>{"success"=>true}.to_json + end + + def image_tagging + images = params[:image_ids] + tags = params[:tag_ids] || [] + i = nil + images.each do |image| + img = AlbumImage.find(image) + img.tags = tags + img.save + i = img + end + @album = Album.find(i.album_id.to_s) + @images = @album.album_images + @image_content = [] + @images.each do |image| + @image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}} + end + render :json=>{"galleries" => @image_content}.to_json + end + + def update_image + image = AlbumImage.find(params[:image_id]) + image.update_attributes(update_params) + image.save! + @album = Album.find(image.album_id.to_s) + @images = @album.album_images + @image_content = [] + @images.each do |image| + @image_content << {"id" => image.id.to_s, "description" => image.description_translations,"tags" => image.tags.collect{|t| t.id.to_s}} + end + render :json=>{"galleries" => @image_content}.to_json + end + + private + + def setup_vars + @module_app = ModuleApp.where(:key=>"gallery").first + end + + def update_params + params.require(:album_image).permit! + end +end \ No newline at end of file diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb new file mode 100644 index 0000000..424ec43 --- /dev/null +++ b/app/controllers/galleries_controller.rb @@ -0,0 +1,48 @@ +class GalleriesController < ApplicationController + def index + albums = Album.filter_by_categories.collect do |a| + { + "album-name" => a.name, + "link_to_show" => OrbitHelper.url_to_show(a.to_param), + "thumb-src" => a.cover_path || "/assets/gallery/default.jpg" + } + end + { + "data" => albums, + "extras" => {"widget-title"=>"Gallery"} + } + + end + + def show + params = OrbitHelper.params + album = Album.find_by_param(params[:uid]) + images = album.album_images.collect do |a| + { + "link_to_show" => "/" + I18n.locale.to_s + params[:url] + "/-" + a.id.to_s + "?method=theater", + "thumb-src" => a.file.thumb.url + } + end + { + "images" => images, + "data" => {"album-title"=>album.name} + } + end + + def theater + params = OrbitHelper.params + image = AlbumImage.find(params[:uid]) + albumid = image.album_id + album = Album.find(albumid) + images = album.album_images.all + { + "album" => album, + "images" => images, + "image" => image, + "back_to_albums" => OrbitHelper.url_to_show(album.to_param) + } + end + + + +end \ No newline at end of file diff --git a/app/models/album.rb b/app/models/album.rb new file mode 100644 index 0000000..05b8202 --- /dev/null +++ b/app/models/album.rb @@ -0,0 +1,24 @@ +class Album + include Mongoid::Document + include Mongoid::Timestamps + + include OrbitCategory::Categorizable + include OrbitTag::Taggable + include Slug + + field :name, as: :slug_title, localize: true + field :description, localize: true + field :cover, default: "default" + field :cover_path #can refact + field :tag_names + field :uid, type: String + + # has_and_belongs_to_many :tags, :class_name => "GalleryTag" + has_many :album_images, :autosave => true, :dependent => :destroy + accepts_nested_attributes_for :album_images, :allow_destroy => true + + def self.find_by_param(input) + self.find_by(uid: input) + end + +end \ No newline at end of file diff --git a/app/models/album_image.rb b/app/models/album_image.rb new file mode 100644 index 0000000..fcaa0b3 --- /dev/null +++ b/app/models/album_image.rb @@ -0,0 +1,15 @@ +class AlbumImage + include Mongoid::Document + include Mongoid::Timestamps + include OrbitTag::Taggable + + mount_uploader :file, GalleryUploader + + field :title + field :description, localize: true + + # has_and_belongs_to_many :tags, :class_name => "GalleryTag" + + belongs_to :album + +end \ No newline at end of file diff --git a/app/uploaders/gallery_uploader.rb b/app/uploaders/gallery_uploader.rb new file mode 100644 index 0000000..a87ac5f --- /dev/null +++ b/app/uploaders/gallery_uploader.rb @@ -0,0 +1,86 @@ +# encoding: utf-8 +module CarrierWave + module Uploader + module Versions + def recreate_version!(version) + already_cached = cached? + cache_stored_file! if !already_cached + send(version).store! + if !already_cached && @cache_id + tmp_dir = File.expand_path(File.join(cache_dir, cache_id), CarrierWave.root) + FileUtils.rm_rf(tmp_dir) + end + end + end + end +end + +class GalleryUploader < CarrierWave::Uploader::Base + + # Include RMagick or ImageScience support: + # include CarrierWave::RMagick + # include CarrierWave::ImageScience + include CarrierWave::MiniMagick + + # Choose what kind of storage to use for this uploader: + # storage :file + # storage :s3 + + # Override the directory where uploaded files will be stored. + # This is a sensible default for uploaders that are meant to be mounted: + def store_dir + "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" + end + + # Provide a default URL as a default if there hasn't been a file uploaded: + # def default_url + # "/images/fallback/" + [version_name, "default.png"].compact.join('_') + # end + + # Process files as they are uploaded: + # process :scale => [200, 300] + # + # def scale(width, height) + # # do something + # end + + # Create different versions of your uploaded files: + # version :thumb do + # process :scale => [50, 50] + # end + + version :thumb do + process :resize_to_fill => [200, 200] + end + + version :theater do + process :resize_to_limit => [1920, 1080] + end + + version :mobile do + process :resize_to_limit => [1152, 768] + end + + # Add a white list of extensions which are allowed to be uploaded. + # For images you might use something like this: + # def extension_white_list + # %w(jpg jpeg gif png) + # end + + # Override the filename of the uploaded files: + # def filename + # "something.jpg" if original_filename + # end + +# def manipulate! +# raise current_path.inspect +# image = ::MiniMagick::Image.open(current_path) +# image = yield(image) +# image.write(current_path) +# ::MiniMagick::Image.open(current_path) +# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e +# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}") +# end + +end + diff --git a/app/views/admin/galleries/_album.html.erb b/app/views/admin/galleries/_album.html.erb new file mode 100644 index 0000000..9ae2301 --- /dev/null +++ b/app/views/admin/galleries/_album.html.erb @@ -0,0 +1,22 @@ +
  • + + <% if album.cover == "default" %> + <%= image_tag "gallery/default.jpg" %> + <% else %> + + <% end %> +

    <%= album.name %>

    +
    + +
      + <% album.tags.each do |tag| %> + <% r = @tags.select { |k| k.id.to_s == tag.id.to_s } %> +
    • <%= r.map {|t| t.name}[0]%>
    • + <%end%> +
    +
  • \ No newline at end of file diff --git a/app/views/admin/galleries/_form.html.erb b/app/views/admin/galleries/_form.html.erb new file mode 100644 index 0000000..0f212b8 --- /dev/null +++ b/app/views/admin/galleries/_form.html.erb @@ -0,0 +1,106 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> + <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> + <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> + <%= javascript_include_tag "lib/modal-preview" %> + <%= javascript_include_tag "lib/file-type" %> +<% end %> +
    + +
    + + + + + + +
    + + +
    + + +
    + +
    + <%= f.select(:category_id, @categories.collect {|p| [ p.title, p.id ] }) %> +
    +
    + +
    + +
    + + +
    + +
    + <%@tags.each do |tag|%> + + <%end %> +
    +
    + +
    + +
    + + +
    + + + + <% I18n.available_locales.each_with_index do |locale, i| %> + +
    +
    + <%= f.fields_for :name_translations do |name| %> + <%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %> +
    + <%= name.text_field locale, :class => "input-block-level", :placeholder=>"Title",:value => (@album.name_translations[locale] rescue nil) %> +
    + <% end %> +
    +
    + <%= f.fields_for :description_translations do |desc| %> + <%= label_tag(locale, t("gallery.album_desc"), :class=>"control-label muted") %> +
    +
    + <%= desc.text_area locale, :class => "ckeditor input-block-level", :value => (@album.description_translations[locale] rescue nil)%> +
    +
    + <% end %> +
    +
    + <% end %> + +
    + +
    + +
    + <%= f.submit t("gallery.save"), :class=> "btn btn-primary bt-form-save" %> +
    + +
    \ No newline at end of file diff --git a/app/views/admin/galleries/_image.html.erb b/app/views/admin/galleries/_image.html.erb new file mode 100644 index 0000000..b93beb8 --- /dev/null +++ b/app/views/admin/galleries/_image.html.erb @@ -0,0 +1,13 @@ +
  • + + + +
      +
    • ">
    • +
    • +
    • +
    +
    + +
    +
  • \ No newline at end of file diff --git a/app/views/admin/galleries/create.js.erb b/app/views/admin/galleries/create.js.erb new file mode 100644 index 0000000..36cfe29 --- /dev/null +++ b/app/views/admin/galleries/create.js.erb @@ -0,0 +1,3 @@ +var gal = new galleryAPI(); +gal.loadAlbums("all"); +rcom.modalWindowClose(); diff --git a/app/views/admin/galleries/edit.html.erb b/app/views/admin/galleries/edit.html.erb new file mode 100644 index 0000000..a875509 --- /dev/null +++ b/app/views/admin/galleries/edit.html.erb @@ -0,0 +1,3 @@ +<%= form_for @album, :url => {:action => "update"}, :html => {:class => 'form-horizontal main-forms'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> diff --git a/app/views/admin/galleries/index.html.erb b/app/views/admin/galleries/index.html.erb index 3d3570d..1b96dc4 100644 --- a/app/views/admin/galleries/index.html.erb +++ b/app/views/admin/galleries/index.html.erb @@ -1,2 +1,20 @@ -

    Admin::Galleries#index

    -

    Find me in app/views/admin/galleries/index.html.erb

    + + +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "gallery" %> +<% end %> + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "jquery.masonry.min.js" %> + <%= javascript_include_tag "jquery.lite.image.resize.js" %> + <%= javascript_include_tag "gallery" %> +<% end %> + + + + + diff --git a/app/views/admin/galleries/new.html.erb b/app/views/admin/galleries/new.html.erb new file mode 100644 index 0000000..474df33 --- /dev/null +++ b/app/views/admin/galleries/new.html.erb @@ -0,0 +1,5 @@ +
    +<%= form_for @album, :url => {:action => "create"}, :html => {:class => 'form-horizontal main-forms'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> +<% end %> +
    diff --git a/app/views/admin/galleries/new_images.html.erb b/app/views/admin/galleries/new_images.html.erb new file mode 100644 index 0000000..cdf89ca --- /dev/null +++ b/app/views/admin/galleries/new_images.html.erb @@ -0,0 +1,3 @@ +<% @newimages.each do |image| %> + <%= render :partial=>"image", :object=>image %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/galleries/show.html.erb b/app/views/admin/galleries/show.html.erb new file mode 100644 index 0000000..0b0b2ab --- /dev/null +++ b/app/views/admin/galleries/show.html.erb @@ -0,0 +1,243 @@ + +<%= stylesheet_link_tag "gallery" %> +<%= stylesheet_link_tag "lib/tags-groups" %> + + +
    +
    + Back +
    + +
    + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + Drop files here +
    + +
    + +
    +
    + +
    +
    +
    +
    + +
    + + +
    + + + + + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "jquery.masonry.min.js" %> + <%= javascript_include_tag "jquery.lite.image.resize.js" %> + <%= javascript_include_tag "lib/checkbox.card" %> + <%= javascript_include_tag "file-upload/vendor/jquery.ui.widget.js" %> + <%= javascript_include_tag "file-upload/tmpl.min.js" %> + <%= javascript_include_tag "file-upload/load-image.min.js" %> + <%= javascript_include_tag "file-upload/canvas-to-blob.min.js" %> + <%= javascript_include_tag "file-upload/jquery.iframe-transport.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload-fp.js" %> + <%= javascript_include_tag "file-upload/jquery.fileupload-ui.js" %> + <%= javascript_include_tag "file-upload/drop-zone.js" %> + <%= javascript_include_tag "gallery" %> +<% end %> + + + + + + + diff --git a/app/views/admin/galleries/upload_panel.html.erb b/app/views/admin/galleries/upload_panel.html.erb new file mode 100755 index 0000000..d5f563f --- /dev/null +++ b/app/views/admin/galleries/upload_panel.html.erb @@ -0,0 +1,107 @@ + + +<%= csrf_meta_tag %> +<%= javascript_include_tag "jquery-latest" %> +<%= stylesheet_link_tag "jquery-ui" %> +<%= stylesheet_link_tag "jquery.fileupload-ui.css" %> + + + +
    +
    + <%= form_for @album, :url => panel_gallery_back_end_upload_image_path, :html => {:class => 'clear'} do |f| %> +
    + + + + + +
    + + <% end %> +
    +
    +
    +
    +
    + + + +
    + + <%= javascript_include_tag "jquery-ui.min" %> + <%= javascript_include_tag "jquery.tmpl.min" %> + <%= javascript_include_tag "jquery.iframe-transport" %> + <%= javascript_include_tag "jquery.fileupload" %> + <%= javascript_include_tag "jquery.fileupload-ui" %> + <%= javascript_include_tag "upload" %> + + + + + diff --git a/app/views/admin/images/show.html.erb b/app/views/admin/images/show.html.erb new file mode 100644 index 0000000..500c2d3 --- /dev/null +++ b/app/views/admin/images/show.html.erb @@ -0,0 +1,59 @@ + +<%= stylesheet_link_tag "gallery_old" %> + + + +<%# content_for :page_specific_javascript do %> + <%= javascript_include_tag "rss" %> + <%= javascript_include_tag "galleryAPI" %> +<%# end %> + + + + + + + diff --git a/app/views/admin/images/upload_panel.html.erb b/app/views/admin/images/upload_panel.html.erb new file mode 100755 index 0000000..be4552b --- /dev/null +++ b/app/views/admin/images/upload_panel.html.erb @@ -0,0 +1,111 @@ + + +<%= csrf_meta_tag %> +<%= javascript_include_tag "jquery-latest" %> +<%= stylesheet_link_tag "jquery-ui" %> +<%= stylesheet_link_tag "jquery.fileupload-ui.css" %> + + + +
    +
    +<%= form_for @album, :url => panel_gallery_back_end_album_path(@album), :html => {:class => 'clear'} do |f| %> + + +
    + + + + + +
    + + <% end %> +
    +
    +
    +
    +
    + + + +
    + + <%= javascript_include_tag "jquery-ui.min" %> + <%= javascript_include_tag "jquery.tmpl.min" %> + <%= javascript_include_tag "jquery.iframe-transport" %> + <%= javascript_include_tag "jquery.fileupload" %> + <%= javascript_include_tag "jquery.fileupload-ui" %> + <%= javascript_include_tag "upload" %> + + + + + diff --git a/app/views/galleries/index.html.erb b/app/views/galleries/index.html.erb new file mode 100644 index 0000000..648b75c --- /dev/null +++ b/app/views/galleries/index.html.erb @@ -0,0 +1 @@ +<%= render_view %> \ No newline at end of file diff --git a/app/views/galleries/show.html.erb b/app/views/galleries/show.html.erb new file mode 100644 index 0000000..9f04326 --- /dev/null +++ b/app/views/galleries/show.html.erb @@ -0,0 +1 @@ +<%= render_view %> diff --git a/app/views/galleries/theater.html.erb b/app/views/galleries/theater.html.erb new file mode 100644 index 0000000..abd77f4 --- /dev/null +++ b/app/views/galleries/theater.html.erb @@ -0,0 +1,72 @@ +<% data = action_data + @images = data["images"] + @album = data["album"] + @image = data["image"] + @back_link = data["back_to_albums"] +%> + +<%= stylesheet_link_tag "gallery_frontend" %> + + + +<%# content_for :page_specific_javascript do %> + <%= javascript_include_tag "galleryAPI_frontend" %> + <%#= javascript_include_tag "jquery.tinyscrollbar" %> + <%= javascript_include_tag "rss" %> +<%# end %> + + + + + + + diff --git a/config/routes.rb b/config/routes.rb index e8a4834..5ca6ba4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,18 @@ Rails.application.routes.draw do scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do - resources :galleries + resources :galleries do + get "imgs" => "galleries#imgs" + end + resources :images + post "galleries/upload_image" => "galleries#upload_image" + + get "new_images" => "galleries#new_images" + post "galleries/set_cover" => "galleries#set_cover" + post "galleries/delete_photos" => "images#delete_photos" + post "galleries/update_image" => "images#update_image" + post "galleries/image_tagging" => "images#image_tagging" + # match "image_tagging" => "album_images#image_tagging" end end end diff --git a/lib/gallery/engine.rb b/lib/gallery/engine.rb index defd750..d167910 100644 --- a/lib/gallery/engine.rb +++ b/lib/gallery/engine.rb @@ -11,9 +11,18 @@ module Gallery side_bar do head_label_i18n 'gallery.gallery', icon_class: "icons-pictures" available_for [:admin,:manager,:sub_manager] - active_for_controllers ({:private=>['gallery']}) + active_for_controllers (['admin/galleries','admin/images']) head_link_path "admin_galleries_path" + context_link 'gallery.all', + :link_path=>"admin_galleries_path" , + :priority=>1, + :active_for_action=>{'admin/galleries'=>"index"} + + context_link 'gallery.new', + :link_path=>"new_admin_gallery_path" , + :priority=>2, + :active_for_action=>{'admin/galleries'=>"new"} end end end