Merge remote branch 'gallery3-contrib/master'
@ -21,7 +21,7 @@ class autorotate_event_Core {
|
||||
// The assumption is that the exception was logged at a lower level, but we
|
||||
// don't want to screw up the processing that was generating the notification
|
||||
// so we don't pass the exception up the call stack
|
||||
static function add_photos_form_completed($item, $form) {
|
||||
static function item_created($item) {
|
||||
try {
|
||||
autorotate::rotate_item($item);
|
||||
} catch (Exception $e) {
|
||||
|
@ -19,12 +19,12 @@
|
||||
*/
|
||||
class autorotate_installer {
|
||||
static function install() {
|
||||
module::set_version("autorotate", 1);
|
||||
module::set_version("autorotate", 2);
|
||||
}
|
||||
|
||||
static function upgrade($version) {
|
||||
if ($version == 1) {
|
||||
module::set_version("autorotate", $version = 1);
|
||||
module::set_version("autorotate", $version = 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,9 @@ class navcarousel_theme_Core {
|
||||
static function head($theme) {
|
||||
if ($theme->page_type == "item") {
|
||||
if (locales::is_rtl()) {
|
||||
$rtl_support = "horizontalDirection: 'rtl',\n";
|
||||
$rtl_support = "rtl: true,\n";
|
||||
} else {
|
||||
$rtl_support = "";
|
||||
$rtl_support = "rtl: false,\n";
|
||||
}
|
||||
$carouselwidth = module::get_var("navcarousel", "carouselwidth", "600");
|
||||
if ($carouselwidth == 0) {
|
||||
@ -89,6 +89,7 @@ class navcarousel_theme_Core {
|
||||
jQuery(document).ready(function() {\n
|
||||
jQuery('#navcarousel').jcarousel({\n
|
||||
". $ajaxhandler ."
|
||||
itemFallbackDimension: ". ($thumbsize + 25) .",\n
|
||||
start: ". $itemoffset .",\n
|
||||
size: ". $childcount .",\n
|
||||
visible: ". $showelements .",\n
|
||||
|
917
modules/navcarousel/js/jquery.jcarousel.js
Normal file
@ -0,0 +1,917 @@
|
||||
/*!
|
||||
* jCarousel - Riding carousels with jQuery
|
||||
* http://sorgalla.com/jcarousel/
|
||||
*
|
||||
* Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* Built on top of the jQuery library
|
||||
* http://jquery.com
|
||||
*
|
||||
* Inspired by the "Carousel Component" by Bill Scott
|
||||
* http://billwscott.com/carousel/
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
/**
|
||||
* Creates a carousel for all matched elements.
|
||||
*
|
||||
* @example $("#mycarousel").jcarousel();
|
||||
* @before <ul id="mycarousel" class="jcarousel-skin-name"><li>First item</li><li>Second item</li></ul>
|
||||
* @result
|
||||
*
|
||||
* <div class="jcarousel-skin-name">
|
||||
* <div class="jcarousel-container">
|
||||
* <div class="jcarousel-clip">
|
||||
* <ul class="jcarousel-list">
|
||||
* <li class="jcarousel-item-1">First item</li>
|
||||
* <li class="jcarousel-item-2">Second item</li>
|
||||
* </ul>
|
||||
* </div>
|
||||
* <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
|
||||
* <div class="jcarousel-next"></div>
|
||||
* </div>
|
||||
* </div>
|
||||
*
|
||||
* @method jcarousel
|
||||
* @return jQuery
|
||||
* @param o {Hash|String} A set of key/value pairs to set as configuration properties or a method name to call on a formerly created instance.
|
||||
*/
|
||||
$.fn.jcarousel = function(o) {
|
||||
if (typeof o == 'string') {
|
||||
var instance = $(this).data('jcarousel'), args = Array.prototype.slice.call(arguments, 1);
|
||||
return instance[o].apply(instance, args);
|
||||
} else
|
||||
return this.each(function() {
|
||||
$(this).data('jcarousel', new $jc(this, o));
|
||||
});
|
||||
};
|
||||
|
||||
// Default configuration properties.
|
||||
var defaults = {
|
||||
vertical: false,
|
||||
rtl: false,
|
||||
start: 1,
|
||||
offset: 1,
|
||||
size: null,
|
||||
scroll: 3,
|
||||
visible: null,
|
||||
animation: 'normal',
|
||||
easing: 'swing',
|
||||
auto: 0,
|
||||
wrap: null,
|
||||
initCallback: null,
|
||||
reloadCallback: null,
|
||||
itemLoadCallback: null,
|
||||
itemFirstInCallback: null,
|
||||
itemFirstOutCallback: null,
|
||||
itemLastInCallback: null,
|
||||
itemLastOutCallback: null,
|
||||
itemVisibleInCallback: null,
|
||||
itemVisibleOutCallback: null,
|
||||
buttonNextHTML: '<div></div>',
|
||||
buttonPrevHTML: '<div></div>',
|
||||
buttonNextEvent: 'click',
|
||||
buttonPrevEvent: 'click',
|
||||
buttonNextCallback: null,
|
||||
buttonPrevCallback: null,
|
||||
itemFallbackDimension: null
|
||||
}, windowLoaded = false;
|
||||
|
||||
$(window).bind('load.jcarousel', function() { windowLoaded = true; })
|
||||
|
||||
/**
|
||||
* The jCarousel object.
|
||||
*
|
||||
* @constructor
|
||||
* @class jcarousel
|
||||
* @param e {HTMLElement} The element to create the carousel for.
|
||||
* @param o {Object} A set of key/value pairs to set as configuration properties.
|
||||
* @cat Plugins/jCarousel
|
||||
*/
|
||||
$.jcarousel = function(e, o) {
|
||||
this.options = $.extend({}, defaults, o || {});
|
||||
|
||||
this.locked = false;
|
||||
|
||||
this.container = null;
|
||||
this.clip = null;
|
||||
this.list = null;
|
||||
this.buttonNext = null;
|
||||
this.buttonPrev = null;
|
||||
|
||||
// Only set if not explicitly passed as option
|
||||
if (!o || o.rtl === undefined)
|
||||
this.options.rtl = ($(e).attr('dir') || $('html').attr('dir') || '').toLowerCase() == 'rtl';
|
||||
|
||||
this.wh = !this.options.vertical ? 'width' : 'height';
|
||||
this.lt = !this.options.vertical ? (this.options.rtl ? 'right' : 'left') : 'top';
|
||||
|
||||
// Extract skin class
|
||||
var skin = '', split = e.className.split(' ');
|
||||
|
||||
for (var i = 0; i < split.length; i++) {
|
||||
if (split[i].indexOf('jcarousel-skin') != -1) {
|
||||
$(e).removeClass(split[i]);
|
||||
skin = split[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.nodeName.toUpperCase() == 'UL' || e.nodeName.toUpperCase() == 'OL') {
|
||||
this.list = $(e);
|
||||
this.container = this.list.parent();
|
||||
|
||||
if (this.container.hasClass('jcarousel-clip')) {
|
||||
if (!this.container.parent().hasClass('jcarousel-container'))
|
||||
this.container = this.container.wrap('<div></div>');
|
||||
|
||||
this.container = this.container.parent();
|
||||
} else if (!this.container.hasClass('jcarousel-container'))
|
||||
this.container = this.list.wrap('<div></div>').parent();
|
||||
} else {
|
||||
this.container = $(e);
|
||||
this.list = this.container.find('ul,ol').eq(0);
|
||||
}
|
||||
|
||||
if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1)
|
||||
this.container.wrap('<div class=" '+ skin + '"></div>');
|
||||
|
||||
this.clip = this.list.parent();
|
||||
|
||||
if (!this.clip.length || !this.clip.hasClass('jcarousel-clip'))
|
||||
this.clip = this.list.wrap('<div></div>').parent();
|
||||
|
||||
this.buttonNext = $('.jcarousel-next', this.container);
|
||||
|
||||
if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null)
|
||||
this.buttonNext = this.clip.after(this.options.buttonNextHTML).next();
|
||||
|
||||
this.buttonNext.addClass(this.className('jcarousel-next'));
|
||||
|
||||
this.buttonPrev = $('.jcarousel-prev', this.container);
|
||||
|
||||
if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null)
|
||||
this.buttonPrev = this.clip.after(this.options.buttonPrevHTML).next();
|
||||
|
||||
this.buttonPrev.addClass(this.className('jcarousel-prev'));
|
||||
|
||||
this.clip.addClass(this.className('jcarousel-clip')).css({
|
||||
overflow: 'hidden',
|
||||
position: 'relative'
|
||||
});
|
||||
this.list.addClass(this.className('jcarousel-list')).css({
|
||||
overflow: 'hidden',
|
||||
position: 'relative',
|
||||
top: 0,
|
||||
margin: 0,
|
||||
padding: 0
|
||||
}).css((this.options.rtl ? 'right' : 'left'), 0);
|
||||
this.container.addClass(this.className('jcarousel-container')).css({
|
||||
position: 'relative'
|
||||
});
|
||||
if (!this.options.vertical && this.options.rtl)
|
||||
this.container.addClass('jcarousel-direction-rtl').attr('dir', 'rtl');
|
||||
|
||||
var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
|
||||
var li = this.list.children('li');
|
||||
|
||||
var self = this;
|
||||
|
||||
if (li.size() > 0) {
|
||||
var wh = 0, i = this.options.offset;
|
||||
li.each(function() {
|
||||
self.format(this, i++);
|
||||
wh += self.dimension(this, di);
|
||||
});
|
||||
|
||||
this.list.css(this.wh, (wh + 100) + 'px');
|
||||
|
||||
// Only set if not explicitly passed as option
|
||||
if (!o || o.size === undefined)
|
||||
this.options.size = li.size();
|
||||
}
|
||||
|
||||
// For whatever reason, .show() does not work in Safari...
|
||||
this.container.css('display', 'block');
|
||||
this.buttonNext.css('display', 'block');
|
||||
this.buttonPrev.css('display', 'block');
|
||||
|
||||
this.funcNext = function() { self.next(); };
|
||||
this.funcPrev = function() { self.prev(); };
|
||||
this.funcResize = function() { self.reload(); };
|
||||
|
||||
if (this.options.initCallback != null)
|
||||
this.options.initCallback(this, 'init');
|
||||
|
||||
if (!windowLoaded && $.browser.safari) {
|
||||
this.buttons(false, false);
|
||||
$(window).bind('load.jcarousel', function() { self.setup(); });
|
||||
} else
|
||||
this.setup();
|
||||
};
|
||||
|
||||
// Create shortcut for internal use
|
||||
var $jc = $.jcarousel;
|
||||
|
||||
$jc.fn = $jc.prototype = {
|
||||
jcarousel: '0.2.5'
|
||||
};
|
||||
|
||||
$jc.fn.extend = $jc.extend = $.extend;
|
||||
|
||||
$jc.fn.extend({
|
||||
/**
|
||||
* Setups the carousel.
|
||||
*
|
||||
* @method setup
|
||||
* @return undefined
|
||||
*/
|
||||
setup: function() {
|
||||
this.first = null;
|
||||
this.last = null;
|
||||
this.prevFirst = null;
|
||||
this.prevLast = null;
|
||||
this.animating = false;
|
||||
this.timer = null;
|
||||
this.tail = null;
|
||||
this.inTail = false;
|
||||
|
||||
if (this.locked)
|
||||
return;
|
||||
|
||||
this.list.css(this.lt, this.pos(this.options.offset) + 'px');
|
||||
var p = this.pos(this.options.start);
|
||||
this.prevFirst = this.prevLast = null;
|
||||
this.animate(p, false);
|
||||
|
||||
$(window).unbind('resize.jcarousel', this.funcResize).bind('resize.jcarousel', this.funcResize);
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears the list and resets the carousel.
|
||||
*
|
||||
* @method reset
|
||||
* @return undefined
|
||||
*/
|
||||
reset: function() {
|
||||
this.list.empty();
|
||||
|
||||
this.list.css(this.lt, '0px');
|
||||
this.list.css(this.wh, '10px');
|
||||
|
||||
if (this.options.initCallback != null)
|
||||
this.options.initCallback(this, 'reset');
|
||||
|
||||
this.setup();
|
||||
},
|
||||
|
||||
/**
|
||||
* Reloads the carousel and adjusts positions.
|
||||
*
|
||||
* @method reload
|
||||
* @return undefined
|
||||
*/
|
||||
reload: function() {
|
||||
if (this.tail != null && this.inTail)
|
||||
this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail);
|
||||
|
||||
this.tail = null;
|
||||
this.inTail = false;
|
||||
|
||||
if (this.options.reloadCallback != null)
|
||||
this.options.reloadCallback(this);
|
||||
|
||||
if (this.options.visible != null) {
|
||||
var self = this;
|
||||
var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0;
|
||||
this.list.children('li').each(function(i) {
|
||||
wh += self.dimension(this, di);
|
||||
if (i + 1 < self.first)
|
||||
lt = wh;
|
||||
});
|
||||
|
||||
this.list.css(this.wh, wh + 'px');
|
||||
this.list.css(this.lt, -lt + 'px');
|
||||
}
|
||||
|
||||
this.scroll(this.first, false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Locks the carousel.
|
||||
*
|
||||
* @method lock
|
||||
* @return undefined
|
||||
*/
|
||||
lock: function() {
|
||||
this.locked = true;
|
||||
this.buttons();
|
||||
},
|
||||
|
||||
/**
|
||||
* Unlocks the carousel.
|
||||
*
|
||||
* @method unlock
|
||||
* @return undefined
|
||||
*/
|
||||
unlock: function() {
|
||||
this.locked = false;
|
||||
this.buttons();
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the size of the carousel.
|
||||
*
|
||||
* @method size
|
||||
* @return undefined
|
||||
* @param s {Number} The size of the carousel.
|
||||
*/
|
||||
size: function(s) {
|
||||
if (s != undefined) {
|
||||
this.options.size = s;
|
||||
if (!this.locked)
|
||||
this.buttons();
|
||||
}
|
||||
|
||||
return this.options.size;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether a list element exists for the given index (or index range).
|
||||
*
|
||||
* @method get
|
||||
* @return bool
|
||||
* @param i {Number} The index of the (first) element.
|
||||
* @param i2 {Number} The index of the last element.
|
||||
*/
|
||||
has: function(i, i2) {
|
||||
if (i2 == undefined || !i2)
|
||||
i2 = i;
|
||||
|
||||
if (this.options.size !== null && i2 > this.options.size)
|
||||
i2 = this.options.size;
|
||||
|
||||
for (var j = i; j <= i2; j++) {
|
||||
var e = this.get(j);
|
||||
if (!e.length || e.hasClass('jcarousel-item-placeholder'))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a jQuery object with list element for the given index.
|
||||
*
|
||||
* @method get
|
||||
* @return jQuery
|
||||
* @param i {Number} The index of the element.
|
||||
*/
|
||||
get: function(i) {
|
||||
return $('.jcarousel-item-' + i, this.list);
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds an element for the given index to the list.
|
||||
* If the element already exists, it updates the inner html.
|
||||
* Returns the created element as jQuery object.
|
||||
*
|
||||
* @method add
|
||||
* @return jQuery
|
||||
* @param i {Number} The index of the element.
|
||||
* @param s {String} The innerHTML of the element.
|
||||
*/
|
||||
add: function(i, s) {
|
||||
var e = this.get(i), old = 0, n = $(s);
|
||||
|
||||
if (e.length == 0) {
|
||||
var c, e = this.create(i), j = $jc.intval(i);
|
||||
while (c = this.get(--j)) {
|
||||
if (j <= 0 || c.length) {
|
||||
j <= 0 ? this.list.prepend(e) : c.after(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
old = this.dimension(e);
|
||||
|
||||
if (n.get(0).nodeName.toUpperCase() == 'LI') {
|
||||
e.replaceWith(n);
|
||||
e = n;
|
||||
} else
|
||||
e.empty().append(s);
|
||||
|
||||
this.format(e.removeClass(this.className('jcarousel-item-placeholder')), i);
|
||||
|
||||
var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null;
|
||||
var wh = this.dimension(e, di) - old;
|
||||
|
||||
if (i > 0 && i < this.first)
|
||||
this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px');
|
||||
|
||||
this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px');
|
||||
|
||||
return e;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes an element for the given index from the list.
|
||||
*
|
||||
* @method remove
|
||||
* @return undefined
|
||||
* @param i {Number} The index of the element.
|
||||
*/
|
||||
remove: function(i) {
|
||||
var e = this.get(i);
|
||||
|
||||
// Check if item exists and is not currently visible
|
||||
if (!e.length || (i >= this.first && i <= this.last))
|
||||
return;
|
||||
|
||||
var d = this.dimension(e);
|
||||
|
||||
if (i < this.first)
|
||||
this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px');
|
||||
|
||||
e.remove();
|
||||
|
||||
this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px');
|
||||
},
|
||||
|
||||
/**
|
||||
* Moves the carousel forwards.
|
||||
*
|
||||
* @method next
|
||||
* @return undefined
|
||||
*/
|
||||
next: function() {
|
||||
this.stopAuto();
|
||||
|
||||
if (this.tail != null && !this.inTail)
|
||||
this.scrollTail(false);
|
||||
else
|
||||
this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll);
|
||||
},
|
||||
|
||||
/**
|
||||
* Moves the carousel backwards.
|
||||
*
|
||||
* @method prev
|
||||
* @return undefined
|
||||
*/
|
||||
prev: function() {
|
||||
this.stopAuto();
|
||||
|
||||
if (this.tail != null && this.inTail)
|
||||
this.scrollTail(true);
|
||||
else
|
||||
this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll);
|
||||
},
|
||||
|
||||
/**
|
||||
* Scrolls the tail of the carousel.
|
||||
*
|
||||
* @method scrollTail
|
||||
* @return undefined
|
||||
* @param b {Boolean} Whether scroll the tail back or forward.
|
||||
*/
|
||||
scrollTail: function(b) {
|
||||
if (this.locked || this.animating || !this.tail)
|
||||
return;
|
||||
|
||||
var pos = $jc.intval(this.list.css(this.lt));
|
||||
|
||||
!b ? pos -= this.tail : pos += this.tail;
|
||||
this.inTail = !b;
|
||||
|
||||
// Save for callbacks
|
||||
this.prevFirst = this.first;
|
||||
this.prevLast = this.last;
|
||||
|
||||
this.animate(pos);
|
||||
},
|
||||
|
||||
/**
|
||||
* Scrolls the carousel to a certain position.
|
||||
*
|
||||
* @method scroll
|
||||
* @return undefined
|
||||
* @param i {Number} The index of the element to scoll to.
|
||||
* @param a {Boolean} Flag indicating whether to perform animation.
|
||||
*/
|
||||
scroll: function(i, a) {
|
||||
if (this.locked || this.animating)
|
||||
return;
|
||||
|
||||
this.animate(this.pos(i), a);
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepares the carousel and return the position for a certian index.
|
||||
*
|
||||
* @method pos
|
||||
* @return {Number}
|
||||
* @param i {Number} The index of the element to scoll to.
|
||||
*/
|
||||
pos: function(i) {
|
||||
var pos = $jc.intval(this.list.css(this.lt));
|
||||
|
||||
if (this.locked || this.animating)
|
||||
return pos;
|
||||
|
||||
if (this.options.wrap != 'circular')
|
||||
i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i);
|
||||
|
||||
var back = this.first > i;
|
||||
|
||||
// Create placeholders, new list width/height
|
||||
// and new list position
|
||||
var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first;
|
||||
var c = back ? this.get(f) : this.get(this.last);
|
||||
var j = back ? f : f - 1;
|
||||
var e = null, l = 0, p = false, d = 0, g;
|
||||
|
||||
while (back ? --j >= i : ++j < i) {
|
||||
e = this.get(j);
|
||||
p = !e.length;
|
||||
if (e.length == 0) {
|
||||
e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
|
||||
c[back ? 'before' : 'after' ](e);
|
||||
|
||||
if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
|
||||
g = this.get(this.index(j));
|
||||
if (g.length)
|
||||
e = this.add(j, g.clone(true));
|
||||
}
|
||||
}
|
||||
|
||||
c = e;
|
||||
d = this.dimension(e);
|
||||
|
||||
if (p)
|
||||
l += d;
|
||||
|
||||
if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size))))
|
||||
pos = back ? pos + d : pos - d;
|
||||
}
|
||||
|
||||
// Calculate visible items
|
||||
var clipping = this.clipping();
|
||||
var cache = [];
|
||||
var visible = 0, j = i, v = 0;
|
||||
var c = this.get(i - 1);
|
||||
|
||||
while (++visible) {
|
||||
e = this.get(j);
|
||||
p = !e.length;
|
||||
if (e.length == 0) {
|
||||
e = this.create(j).addClass(this.className('jcarousel-item-placeholder'));
|
||||
// This should only happen on a next scroll
|
||||
c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e);
|
||||
|
||||
if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) {
|
||||
g = this.get(this.index(j));
|
||||
if (g.length)
|
||||
e = this.add(j, g.clone(true));
|
||||
}
|
||||
}
|
||||
|
||||
c = e;
|
||||
var d = this.dimension(e);
|
||||
if (d == 0) {
|
||||
throw new Error('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...');
|
||||
}
|
||||
|
||||
if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size)
|
||||
cache.push(e);
|
||||
else if (p)
|
||||
l += d;
|
||||
|
||||
v += d;
|
||||
|
||||
if (v >= clipping)
|
||||
break;
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
// Remove out-of-range placeholders
|
||||
for (var x = 0; x < cache.length; x++)
|
||||
cache[x].remove();
|
||||
|
||||
// Resize list
|
||||
if (l > 0) {
|
||||
this.list.css(this.wh, this.dimension(this.list) + l + 'px');
|
||||
|
||||
if (back) {
|
||||
pos -= l;
|
||||
this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate first and last item
|
||||
var last = i + visible - 1;
|
||||
if (this.options.wrap != 'circular' && this.options.size && last > this.options.size)
|
||||
last = this.options.size;
|
||||
|
||||
if (j > last) {
|
||||
visible = 0, j = last, v = 0;
|
||||
while (++visible) {
|
||||
var e = this.get(j--);
|
||||
if (!e.length)
|
||||
break;
|
||||
v += this.dimension(e);
|
||||
if (v >= clipping)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var first = last - visible + 1;
|
||||
if (this.options.wrap != 'circular' && first < 1)
|
||||
first = 1;
|
||||
|
||||
if (this.inTail && back) {
|
||||
pos += this.tail;
|
||||
this.inTail = false;
|
||||
}
|
||||
|
||||
this.tail = null;
|
||||
if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) {
|
||||
var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom');
|
||||
if ((v - m) > clipping)
|
||||
this.tail = v - clipping - m;
|
||||
}
|
||||
|
||||
// Adjust position
|
||||
while (i-- > first)
|
||||
pos += this.dimension(this.get(i));
|
||||
|
||||
// Save visible item range
|
||||
this.prevFirst = this.first;
|
||||
this.prevLast = this.last;
|
||||
this.first = first;
|
||||
this.last = last;
|
||||
|
||||
return pos;
|
||||
},
|
||||
|
||||
/**
|
||||
* Animates the carousel to a certain position.
|
||||
*
|
||||
* @method animate
|
||||
* @return undefined
|
||||
* @param p {Number} Position to scroll to.
|
||||
* @param a {Boolean} Flag indicating whether to perform animation.
|
||||
*/
|
||||
animate: function(p, a) {
|
||||
if (this.locked || this.animating)
|
||||
return;
|
||||
|
||||
this.animating = true;
|
||||
|
||||
var self = this;
|
||||
var scrolled = function() {
|
||||
self.animating = false;
|
||||
|
||||
if (p == 0)
|
||||
self.list.css(self.lt, 0);
|
||||
|
||||
if (self.options.wrap == 'circular' || self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size)
|
||||
self.startAuto();
|
||||
|
||||
self.buttons();
|
||||
self.notify('onAfterAnimation');
|
||||
|
||||
// This function removes items which are appended automatically for circulation.
|
||||
// This prevents the list from growing infinitely.
|
||||
if (self.options.wrap == 'circular' && self.options.size !== null)
|
||||
for (var i = self.prevFirst; i <= self.prevLast; i++)
|
||||
if (i !== null && !(i >= self.first && i <= self.last) && (i < 1 || i > self.options.size))
|
||||
self.remove(i);
|
||||
};
|
||||
|
||||
this.notify('onBeforeAnimation');
|
||||
|
||||
// Animate
|
||||
if (!this.options.animation || a == false) {
|
||||
this.list.css(this.lt, p + 'px');
|
||||
scrolled();
|
||||
} else {
|
||||
var o = !this.options.vertical ? (this.options.rtl ? {'right': p} : {'left': p}) : {'top': p};
|
||||
this.list.animate(o, this.options.animation, this.options.easing, scrolled);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Starts autoscrolling.
|
||||
*
|
||||
* @method auto
|
||||
* @return undefined
|
||||
* @param s {Number} Seconds to periodically autoscroll the content.
|
||||
*/
|
||||
startAuto: function(s) {
|
||||
if (s != undefined)
|
||||
this.options.auto = s;
|
||||
|
||||
if (this.options.auto == 0)
|
||||
return this.stopAuto();
|
||||
|
||||
if (this.timer != null)
|
||||
return;
|
||||
|
||||
var self = this;
|
||||
this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000);
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops autoscrolling.
|
||||
*
|
||||
* @method stopAuto
|
||||
* @return undefined
|
||||
*/
|
||||
stopAuto: function() {
|
||||
if (this.timer == null)
|
||||
return;
|
||||
|
||||
clearTimeout(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the states of the prev/next buttons.
|
||||
*
|
||||
* @method buttons
|
||||
* @return undefined
|
||||
*/
|
||||
buttons: function(n, p) {
|
||||
if (n == undefined || n == null) {
|
||||
var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size);
|
||||
if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size)
|
||||
n = this.tail != null && !this.inTail;
|
||||
}
|
||||
|
||||
if (p == undefined || p == null) {
|
||||
var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1);
|
||||
if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1)
|
||||
p = this.tail != null && this.inTail;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent + '.jcarousel', this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true);
|
||||
this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent + '.jcarousel', this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true);
|
||||
|
||||
if (this.options.buttonNextCallback != null && this.buttonNext.data('jcarouselstate') != n) {
|
||||
this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); }).data('jcarouselstate', n);
|
||||
}
|
||||
|
||||
if (this.options.buttonPrevCallback != null && (this.buttonPrev.data('jcarouselstate') != p)) {
|
||||
this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); }).data('jcarouselstate', p);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify callback of a specified event.
|
||||
*
|
||||
* @method notify
|
||||
* @return undefined
|
||||
* @param evt {String} The event name
|
||||
*/
|
||||
notify: function(evt) {
|
||||
var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev');
|
||||
|
||||
// Load items
|
||||
this.callback('itemLoadCallback', evt, state);
|
||||
|
||||
if (this.prevFirst !== this.first) {
|
||||
this.callback('itemFirstInCallback', evt, state, this.first);
|
||||
this.callback('itemFirstOutCallback', evt, state, this.prevFirst);
|
||||
}
|
||||
|
||||
if (this.prevLast !== this.last) {
|
||||
this.callback('itemLastInCallback', evt, state, this.last);
|
||||
this.callback('itemLastOutCallback', evt, state, this.prevLast);
|
||||
}
|
||||
|
||||
this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast);
|
||||
this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last);
|
||||
},
|
||||
|
||||
callback: function(cb, evt, state, i1, i2, i3, i4) {
|
||||
if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation'))
|
||||
return;
|
||||
|
||||
var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb];
|
||||
|
||||
if (!$.isFunction(callback))
|
||||
return;
|
||||
|
||||
var self = this;
|
||||
|
||||
if (i1 === undefined)
|
||||
callback(self, state, evt);
|
||||
else if (i2 === undefined)
|
||||
this.get(i1).each(function() { callback(self, this, i1, state, evt); });
|
||||
else {
|
||||
for (var i = i1; i <= i2; i++)
|
||||
if (i !== null && !(i >= i3 && i <= i4))
|
||||
this.get(i).each(function() { callback(self, this, i, state, evt); });
|
||||
}
|
||||
},
|
||||
|
||||
create: function(i) {
|
||||
return this.format('<li></li>', i);
|
||||
},
|
||||
|
||||
format: function(e, i) {
|
||||
var e = $(e), split = e.get(0).className.split(' ');
|
||||
for (var j = 0; j < split.length; j++) {
|
||||
if (split[j].indexOf('jcarousel-') != -1) {
|
||||
e.removeClass(split[j]);
|
||||
}
|
||||
}
|
||||
e.addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i)).css({
|
||||
'float': (this.options.rtl ? 'right' : 'left'),
|
||||
'list-style': 'none'
|
||||
}).attr('jcarouselindex', i);
|
||||
return e;
|
||||
},
|
||||
|
||||
className: function(c) {
|
||||
return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical');
|
||||
},
|
||||
|
||||
dimension: function(e, d) {
|
||||
var el = e.jquery != undefined ? e[0] : e;
|
||||
|
||||
var old = !this.options.vertical ?
|
||||
(el.offsetWidth || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') :
|
||||
(el.offsetHeight || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom');
|
||||
|
||||
if (d == undefined || old == d)
|
||||
return old;
|
||||
|
||||
var w = !this.options.vertical ?
|
||||
d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') :
|
||||
d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom');
|
||||
|
||||
$(el).css(this.wh, w + 'px');
|
||||
|
||||
return this.dimension(el);
|
||||
},
|
||||
|
||||
clipping: function() {
|
||||
return !this.options.vertical ?
|
||||
this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) :
|
||||
this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth'));
|
||||
},
|
||||
|
||||
index: function(i, s) {
|
||||
if (s == undefined)
|
||||
s = this.options.size;
|
||||
|
||||
return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1;
|
||||
}
|
||||
});
|
||||
|
||||
$jc.extend({
|
||||
/**
|
||||
* Gets/Sets the global default configuration properties.
|
||||
*
|
||||
* @method defaults
|
||||
* @return {Object}
|
||||
* @param d {Object} A set of key/value pairs to set as configuration properties.
|
||||
*/
|
||||
defaults: function(d) {
|
||||
return $.extend(defaults, d || {});
|
||||
},
|
||||
|
||||
margin: function(e, p) {
|
||||
if (!e)
|
||||
return 0;
|
||||
|
||||
var el = e.jquery != undefined ? e[0] : e;
|
||||
|
||||
if (p == 'marginRight' && $.browser.safari) {
|
||||
var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2;
|
||||
|
||||
$.swap(el, old, function() { oWidth = el.offsetWidth; });
|
||||
|
||||
old['marginRight'] = 0;
|
||||
$.swap(el, old, function() { oWidth2 = el.offsetWidth; });
|
||||
|
||||
return oWidth2 - oWidth;
|
||||
}
|
||||
|
||||
return $jc.intval($.css(el, p));
|
||||
},
|
||||
|
||||
intval: function(v) {
|
||||
v = parseInt(v);
|
||||
return isNaN(v) ? 0 : v;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
@ -1,3 +1,3 @@
|
||||
name = "Navigation Carousel"
|
||||
description = "Adds a navigation carousel under the photo."
|
||||
version = 4.2
|
||||
version = 4
|
||||
|
@ -43,7 +43,7 @@ class Admin_Photoannotation_Controller extends Admin_Controller {
|
||||
//Load the target user
|
||||
$targetuser = ORM::factory("user", $form->targetuser->value);
|
||||
if (!$targetuser->loaded()) {
|
||||
message::error(t("The specified user could not be found"));
|
||||
message::error(t("The specified person could not be found"));
|
||||
url::redirect("admin/photoannotation/converter");
|
||||
}
|
||||
//Load all existing tag annotations
|
||||
@ -280,12 +280,12 @@ class Admin_Photoannotation_Controller extends Admin_Controller {
|
||||
->checked(module::get_var("photoannotation", "shownotes", false));
|
||||
$group->checkbox("fullname")->label(t("Show full name of a user instead of the username on annotations (username will be dispayed for users without a full name)."))
|
||||
->checked(module::get_var("photoannotation", "fullname", false));
|
||||
$group = $form->group("notifications")->label(t("Notification and user cloud settings"));
|
||||
$group = $form->group("notifications")->label(t("Notification and people cloud settings"));
|
||||
$group->checkbox("nonotifications")->label(t("Disable user notifications."))
|
||||
->checked(module::get_var("photoannotation", "nonotifications", false));
|
||||
$group->checkbox("notificationoptout")->label(t("Notify users by default (only applies to new users and user who have not saved their profile after installing this module)."))
|
||||
->checked(module::get_var("photoannotation", "notificationoptout", false));
|
||||
$group->checkbox("allowguestsearch")->label(t("Show user cloud and allow user search for guests."))
|
||||
$group->checkbox("allowguestsearch")->label(t("Show people cloud and allow people search for guests."))
|
||||
->checked(module::get_var("photoannotation", "allowguestsearch", false));
|
||||
$group = $form->group("newtagmail")->label(t("Customize the mail sent to users when a user annotation is created"));
|
||||
$group->input("newtagsubject")->label(t("Subject"))
|
||||
|
@ -20,7 +20,7 @@
|
||||
class photoannotation_Controller extends Controller {
|
||||
public function showuser() {
|
||||
if (identity::active_user()->guest && !module::get_var("photoannotation", "allowguestsearch", false)) {
|
||||
message::error(t("You have to log in to perform a user search."));
|
||||
message::error(t("You have to log in to perform a people search."));
|
||||
url::redirect(url::site());
|
||||
return;
|
||||
}
|
||||
@ -83,18 +83,17 @@ class photoannotation_Controller extends Controller {
|
||||
$user_id = "";
|
||||
$user_id = $_POST["userlist"];
|
||||
$description = $_POST["desc"];
|
||||
$error_noselection = t("Please select a person or tag or specify a title.");
|
||||
$redir_uri = url::abs_site("{$item->type}s/{$item->id}");
|
||||
//If this is a user then get the id
|
||||
if ($user_id != "") {
|
||||
$getuser = photoannotation::getuser($user_id);
|
||||
if (!$getuser->found) {
|
||||
message::error(t("Could not find user %user.", array("user" => $user_id)));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)t("Could not find anyone with the name %user.", array("user" => $user_id))));
|
||||
return;
|
||||
}
|
||||
if ($getuser->isguest) {
|
||||
message::error(t("You cannot create an annotation for the guest user."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)t("You cannot create an annotation for the guest user.")));
|
||||
return;
|
||||
}
|
||||
$user_id = $getuser->user->id;
|
||||
@ -112,19 +111,22 @@ class photoannotation_Controller extends Controller {
|
||||
$tag->save();
|
||||
$tag_data = $tag->id;
|
||||
} else {
|
||||
$tag_data = -1;
|
||||
$tag_data = "";
|
||||
}
|
||||
//Save annotation
|
||||
if ($annotate_id == "new") { //This is a new annotation
|
||||
if ($user_id > -1) { //Save user
|
||||
photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
} elseif ($tag_data > -1) { //Conversion user -> face
|
||||
photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
} elseif ($item_title != "") { //Conversion user -> note
|
||||
photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
} else { //Somethings wrong
|
||||
message::error(t("Please select a User or Tag or specify a Title."));
|
||||
url::redirect($redir_uri);
|
||||
$annotate_id = -1;
|
||||
if ($user_id != "") { //Save user
|
||||
$new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "user";
|
||||
} elseif ($tag_data != "") { //Save face
|
||||
$new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "face";
|
||||
} elseif ($item_title != "") { //Save note
|
||||
$new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "note";
|
||||
} else { //Something's wrong
|
||||
json::reply(array("result" => "error", "message" => (string)$error_noselection));
|
||||
return;
|
||||
}
|
||||
} else { //This is an update to an existing annotation
|
||||
@ -133,17 +135,19 @@ class photoannotation_Controller extends Controller {
|
||||
$updateduser = ORM::factory("items_user") //load the existing user
|
||||
->where("id", "=", $annotate_id)
|
||||
->find();
|
||||
if ($user_id > -1) { //Conversion user -> user
|
||||
photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
} elseif ($tag_data > -1) { //Conversion user -> face
|
||||
photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
if ($user_id != "") { //Conversion user -> user
|
||||
$new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "user";
|
||||
} elseif ($tag_data != "") { //Conversion user -> face
|
||||
$new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "face";
|
||||
$updateduser->delete(); //delete old user
|
||||
} elseif ($item_title != "") { //Conversion user -> note
|
||||
photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "note";
|
||||
$updateduser->delete(); //delete old user
|
||||
} else { //Somethings wrong
|
||||
message::error(t("Please select a User or Tag or specify a Title."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)$error_noselection));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -151,17 +155,19 @@ class photoannotation_Controller extends Controller {
|
||||
$updatedface = ORM::factory("items_face") //load the existing user
|
||||
->where("id", "=", $annotate_id)
|
||||
->find();
|
||||
if ($user_id > -1) { //Conversion face -> user
|
||||
photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
if ($user_id != "") { //Conversion face -> user
|
||||
$new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "user";
|
||||
$updatedface->delete(); //delete old face
|
||||
} elseif ($tag_data > -1) { //Conversion face -> face
|
||||
photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id);
|
||||
} elseif ($tag_data != "") { //Conversion face -> face
|
||||
$new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id);
|
||||
$dest_type = "face";
|
||||
} elseif ($item_title != "") { //Conversion face -> note
|
||||
photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "note";
|
||||
$updatedface->delete(); //delete old face
|
||||
} else { //Somethings wrong
|
||||
message::error(t("Please select a User or Tag or specify a Title."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)$error_noselection));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -169,29 +175,70 @@ class photoannotation_Controller extends Controller {
|
||||
$updatednote = ORM::factory("items_note") //load the existing user
|
||||
->where("id", "=", $annotate_id)
|
||||
->find();
|
||||
if ($user_id > -1) { //Conversion note -> user
|
||||
photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
if ($user_id != "") { //Conversion note -> user
|
||||
$new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "user";
|
||||
$updatednote->delete(); //delete old note
|
||||
} elseif ($tag_data > -1) { //Conversion note -> face
|
||||
photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
} elseif ($tag_data != "") { //Conversion note -> face
|
||||
$new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description);
|
||||
$dest_type = "face";
|
||||
$updatednote->delete(); //delete old note
|
||||
} elseif ($item_title != "") { //Conversion note -> note
|
||||
photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id);
|
||||
$new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id);
|
||||
$dest_type = "note";
|
||||
} else { //Somethings wrong
|
||||
message::error(t("Please select a User or Tag or specify a Title."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)$error_noselection));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
message::error(t("Please select a User or Tag or specify a Title."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "error", "message" => (string)$error_noselection));
|
||||
return;
|
||||
}
|
||||
}
|
||||
message::success(t("Annotation saved."));
|
||||
url::redirect($redir_uri);
|
||||
return;
|
||||
$int_text = "";
|
||||
$editable = true;
|
||||
switch ($dest_type) {
|
||||
case "user":
|
||||
$fullname = module::get_var("photoannotation", "fullname", false);
|
||||
$int_text = $getuser->user->display_name() ." (". $getuser->user->name .")";
|
||||
if ($fullname) {
|
||||
$note_text = $getuser->user->display_name();
|
||||
} else {
|
||||
$note_text = $getuser->user->name;
|
||||
}
|
||||
$note_url = user_profile::url($getuser->user->id);
|
||||
break;
|
||||
case "face":
|
||||
$note_text = $tag->name;
|
||||
$note_url = $tag->url();
|
||||
break;
|
||||
case "note":
|
||||
$note_text = $item_title;
|
||||
$note_url = "";
|
||||
$editable = false;
|
||||
}
|
||||
if ($annotate_id == -1) {
|
||||
$annotation_id = "";
|
||||
} else {
|
||||
$annotation_id = "photoannotation-area-". $notetype ."-". $annotate_id;
|
||||
}
|
||||
$reply = array("result" => "success",
|
||||
"notetype" => (string)$dest_type,
|
||||
"description" => (string)$description,
|
||||
"height" => (integer)$_POST["height"],
|
||||
"internaltext" => (string)$int_text,
|
||||
"left" => (integer)$str_x1,
|
||||
"noteid" => (integer)$new_id,
|
||||
"text" => (string)$note_text,
|
||||
"top" => (integer)$str_y1,
|
||||
"url" => (string)$note_url,
|
||||
"width" => (integer)$_POST["width"],
|
||||
"editable" => (boolean)$editable,
|
||||
"annotationid" => (string)$annotation_id,
|
||||
"oldid" => (string)$annotate_id,
|
||||
"oldtype" => (string)$notetype);
|
||||
json::reply($reply);
|
||||
}
|
||||
|
||||
public function delete($item_data) {
|
||||
@ -224,25 +271,27 @@ class photoannotation_Controller extends Controller {
|
||||
url::redirect($redir_uri);
|
||||
return;
|
||||
}
|
||||
message::success(t("Annotation deleted."));
|
||||
url::redirect($redir_uri);
|
||||
json::reply(array("result" => "success", "notetype" => (string)$notetype, "noteid" => (string)$noteid));
|
||||
}
|
||||
|
||||
public function autocomplete() {
|
||||
$users = array();
|
||||
$user_parts = explode(",", Input::instance()->get("q"));
|
||||
$limit = Input::instance()->get("limit");
|
||||
$user_part = ltrim(end($user_parts));
|
||||
$user_list = ORM::factory("user")
|
||||
->where("name", "LIKE", "{$user_part}%")
|
||||
->order_by("name", "ASC")
|
||||
->limit($limit)
|
||||
->find_all();
|
||||
foreach ($user_list as $user) {
|
||||
if ($user->name != "guest") {
|
||||
$users[] = $user->display_name() ." (". $user->name .")";
|
||||
if (!identity::active_user()->guest || module::get_var("photoannotation", "allowguestsearch", false)) {
|
||||
$users = array();
|
||||
$user_parts = explode(",", Input::instance()->get("q"));
|
||||
$limit = Input::instance()->get("limit");
|
||||
$user_part = ltrim(end($user_parts));
|
||||
$user_list = ORM::factory("user")
|
||||
->where("name", "LIKE", "{$user_part}%")
|
||||
->or_where("full_name", "LIKE", "{$user_part}%")
|
||||
->order_by("full_name", "ASC")
|
||||
->limit($limit)
|
||||
->find_all();
|
||||
foreach ($user_list as $user) {
|
||||
if ($user->name != "guest") {
|
||||
$users[] = $user->display_name() ." (". $user->name .")";
|
||||
}
|
||||
}
|
||||
print implode("\n", $users);
|
||||
}
|
||||
print implode("\n", $users);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,6 @@
|
||||
color: #f30;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.image-annotate-canvas {
|
||||
background-position: left top;
|
||||
background-repeat: no-repeat;
|
||||
@ -96,7 +95,7 @@
|
||||
color: #FFFFFF;
|
||||
display: none;
|
||||
font-family: Verdana, Sans-Serif;
|
||||
font-size: 1.4em;
|
||||
font-size: 0.9em;
|
||||
max-width: 200px;
|
||||
padding: 3px 7px;
|
||||
position: absolute;
|
||||
|
@ -32,7 +32,7 @@ class photoannotation_Core {
|
||||
"SELECT SQL_CALC_FOUND_ROWS {users}.*, " .
|
||||
" MATCH({users}.`name`) AGAINST ('$q' IN BOOLEAN MODE) AS `score` " .
|
||||
"FROM {users} " .
|
||||
"WHERE MATCH({users}.`name`) AGAINST ('$q' IN BOOLEAN MODE) " .
|
||||
"WHERE MATCH({users}.`name`, {users}.`full_name`) AGAINST ('$q' IN BOOLEAN MODE) " .
|
||||
"ORDER BY `score` DESC " .
|
||||
"LIMIT $page_size OFFSET $offset";
|
||||
$data = $db->query($query);
|
||||
@ -42,10 +42,10 @@ class photoannotation_Core {
|
||||
}
|
||||
|
||||
static function get_user_search_form($form_id) {
|
||||
$form = new Forge("photoannotation/showuser/{$item->id}", "", "post", array("id" => $form_id, "class" => "g-short-form"));
|
||||
$label = t("Type user name");
|
||||
$form = new Forge("photoannotation/showuser", "", "post", array("id" => $form_id, "class" => "g-short-form"));
|
||||
$label = t("Search for a person");
|
||||
|
||||
$group = $form->group("showuser")->label("Search for a user");
|
||||
$group = $form->group("showuser")->label("Search for a person");
|
||||
$group->input("name")->label($label)->id("name");
|
||||
$group->submit("")->value(t("Search"));
|
||||
return $form;
|
||||
@ -99,6 +99,7 @@ class photoannotation_Core {
|
||||
$item_user->y2 = $str_y2;
|
||||
$item_user->description = $description;
|
||||
$item_user->save();
|
||||
return $item_user->id;
|
||||
}
|
||||
|
||||
public static function saveface($tag_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id = "") {
|
||||
@ -117,6 +118,7 @@ class photoannotation_Core {
|
||||
$item_face->y2 = $str_y2;
|
||||
$item_face->description = $description;
|
||||
$item_face->save();
|
||||
return $item_face->id;
|
||||
}
|
||||
|
||||
public static function savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id = "") {
|
||||
@ -135,6 +137,7 @@ class photoannotation_Core {
|
||||
$item_note->title = $item_title;
|
||||
$item_note->description = $description;
|
||||
$item_note->save();
|
||||
return $item_note->id;
|
||||
}
|
||||
|
||||
public static function send_notifications($recipient_id, $item_id, $mailtype) {
|
||||
@ -230,17 +233,6 @@ class photoannotation_Core {
|
||||
}
|
||||
return $notification_settings;
|
||||
}
|
||||
|
||||
public static function get_user_cloud() {
|
||||
$users = ORM::factory("user")->order_by("name", "ASC")->find_all();
|
||||
foreach ($users as $user) {
|
||||
$items_users_count = ORM::factory("items_user")->where("user_id", "=", $user->id)->count_all();
|
||||
if ($items_users_count > 0) {
|
||||
$user_array[] = $user->display_name();
|
||||
}
|
||||
}
|
||||
return $user_array;
|
||||
}
|
||||
|
||||
static function cloud($count) {
|
||||
$users = ORM::factory("user")->order_by("name", "ASC")->find_all();
|
||||
@ -262,12 +254,13 @@ class photoannotation_Core {
|
||||
$user_array[$user->name]->url = user_profile::url($user->id);
|
||||
}
|
||||
}
|
||||
$cloud->users = array_slice($user_array, 0, $count);
|
||||
$cloud->max_count = $maxcount;
|
||||
if (!$cloud->max_count) {
|
||||
return;
|
||||
if (isset($user_array)) {
|
||||
$cloud->users = array_slice($user_array, 0, $count);
|
||||
$cloud->max_count = $maxcount;
|
||||
return $cloud;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return $cloud;
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,4 +275,4 @@ class photoannotation_Core {
|
||||
static function annotation_count($user_id) {
|
||||
return ORM::factory("items_user")->where("user_id", "=", $user_id)->count_all();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class photoannotation_block_Core {
|
||||
case "photoannotation":
|
||||
$block = new Block();
|
||||
$block->css_id = "g-photoannotation";
|
||||
$block->title = t("Users");
|
||||
$block->title = t("People");
|
||||
$block->content = new View("photoannotation_block.html");
|
||||
$block->content->cloud = photoannotation::cloud(30);
|
||||
$block->content->form = photoannotation::get_user_search_form("g-user-cloud-form");
|
||||
@ -37,4 +37,4 @@ class photoannotation_block_Core {
|
||||
}
|
||||
return $block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +223,10 @@ class photoannotation_event_Core {
|
||||
$item_users = ORM::factory("items_user")->where("item_id", "=", $comment->item_id)->find_all();
|
||||
if (count($item_users) > 0) {
|
||||
foreach ($item_users as $item_user) {
|
||||
photoannotation::send_notifications($item_user->user_id, $comment->item_id, "newcomment");
|
||||
//Don't send if the commenter is the user to be notified
|
||||
if ($comment->author_id != $item_user->user_id && module::is_active("notification")) {
|
||||
photoannotation::send_notifications($item_user->user_id, $comment->item_id, "newcomment");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,7 +236,10 @@ class photoannotation_event_Core {
|
||||
$item_users = ORM::factory("items_user")->where("item_id", "=", $comment->item_id)->find_all();
|
||||
if (count($item_users) > 0) {
|
||||
foreach ($item_users as $item_user) {
|
||||
photoannotation::send_notifications($item_user->user_id, $comment->item_id, "updatedcomment");
|
||||
//Don't send if the commenter is the user to be notified
|
||||
if ($comment->author_id != $item_user->user_id && module::is_active("notification")) {
|
||||
photoannotation::send_notifications($item_user->user_id, $comment->item_id, "updatedcomment");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class photoannotation_installer {
|
||||
DEFAULT CHARSET=utf8;");
|
||||
|
||||
// Set the module's version number.
|
||||
module::set_version("photoannotation", 3);
|
||||
module::set_version("photoannotation", 4);
|
||||
}
|
||||
|
||||
static function upgrade($version) {
|
||||
|
@ -38,7 +38,7 @@ class photoannotation_theme_Core {
|
||||
} else {
|
||||
$border_thickness = "1px";
|
||||
}
|
||||
if (!$noborder || !$noeditablehover || !$nohover) {
|
||||
if (!$noborder || !$noclickablehover || !$nohover) {
|
||||
if (!$noborder) {
|
||||
$v .= ".image-annotate-area {\n
|
||||
border: 1px solid ". $bordercolor .";\n
|
||||
|
@ -26,12 +26,13 @@
|
||||
this.cssaclass = opts.cssaclass;
|
||||
this.rtlsupport = opts.rtlsupport;
|
||||
this.users = opts.users;
|
||||
anchor = $('.g-fullsize-link');
|
||||
|
||||
// Add the canvas
|
||||
this.canvas = $('<div class="image-annotate-canvas g-thumbnail"><div class="image-annotate-view"></div><div class="image-annotate-edit"><div class="image-annotate-edit-area"></div></div></div>');
|
||||
this.canvas = $('<div class="image-annotate-canvas g-thumbnail"><div class="image-annotate-view"><div id="photoannotation-fullsize" class="image-annotate-note"></div></div><div class="image-annotate-edit"><div class="image-annotate-edit-area"></div></div></div>');
|
||||
this.canvas.children('.image-annotate-edit').hide();
|
||||
this.canvas.children('.image-annotate-view').hide();
|
||||
this.image.after(this.canvas);
|
||||
$('#g-photo').after(this.canvas);
|
||||
|
||||
// Give the canvas and the container their size and background
|
||||
this.canvas.height(this.height());
|
||||
@ -44,10 +45,12 @@
|
||||
this.canvas.hover(function() {
|
||||
if ($(this).children('.image-annotate-edit').css('display') == 'none') {
|
||||
$(this).children('.image-annotate-view').show();
|
||||
$("#photoannotation-fullsize").show();
|
||||
}
|
||||
}, function() {
|
||||
$(this).children('.image-annotate-view').hide();
|
||||
$(this).children('.image-annotate-note').hide();
|
||||
$("#photoannotation-fullsize").hide();
|
||||
});
|
||||
|
||||
this.canvas.children('.image-annotate-view').hover(function() {
|
||||
@ -75,7 +78,12 @@
|
||||
|
||||
// Hide the original
|
||||
this.hide();
|
||||
|
||||
$('#g-photo').hide();
|
||||
$('.image-annotate-canvas').show();
|
||||
$(".g-resize").remove();
|
||||
$("#photoannotation-fullsize").append($('.g-fullsize-link:first'));
|
||||
$('.g-fullsize-link').append($('.g-fullsize-link:first').attr('title'));
|
||||
$('.image-annotate-canvas').after($('#photoannotation-legend'));
|
||||
return this;
|
||||
};
|
||||
|
||||
@ -142,28 +150,114 @@
|
||||
// Create/prepare the editable note elements
|
||||
var editable = new $.fn.annotateEdit(image, null, tags, labels, saveUrl, csrf, rtlsupport, users);
|
||||
|
||||
$.fn.annotateImage.createSaveButton(editable, image, null, rtlsupport, labels);
|
||||
var okbut = new $.fn.annotateImage.createSaveButton(editable, image, null, rtlsupport, labels, saveUrl);
|
||||
|
||||
editable.form.append(okbut);
|
||||
|
||||
$.fn.annotateImage.createCancelButton(editable, image, rtlsupport, labels);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.annotateImage.createSaveButton = function(editable, image, note, rtlsupport, labels) {
|
||||
$.fn.annotateImage.createSaveButton = function(editable, image, note, rtlsupport, labels, saveUrl) {
|
||||
/// <summary>
|
||||
/// Creates a Save button on the editable note.
|
||||
/// </summary>
|
||||
var ok = $('<a class="image-annotate-edit-ok g-button ui-corner-all ui-icon-left ui-state-default ' + rtlsupport + '">' + labels[8] + '</a>');
|
||||
|
||||
ok.click(function() {
|
||||
var form = $('#image-annotate-edit-form form');
|
||||
var text = $('#image-annotate-text').val();
|
||||
$.fn.annotateImage.appendPosition(form, editable);
|
||||
image.mode = 'view';
|
||||
var form = $('#image-annotate-edit-form form');
|
||||
$.fn.annotateImage.appendPosition(form, editable);
|
||||
$.ajax({
|
||||
url: saveUrl,
|
||||
type: 'POST',
|
||||
data: form.serialize(),
|
||||
error: function(e) {
|
||||
var errordialog = '<div id="image-annotate-error-dialog">' + labels[13] + '<div />';
|
||||
$('body').append(errordialog);
|
||||
var btns = {};
|
||||
if (rtlsupport == "") {
|
||||
diagclass = "inmage-annotate-dialog";
|
||||
} else {
|
||||
diagclass = "inmage-annotate-dialog-rtl";
|
||||
}
|
||||
btns[labels[14]] = function(){
|
||||
$('#image-annotate-error-dialog').remove();
|
||||
};
|
||||
$('#image-annotate-error-dialog').dialog({
|
||||
modal: true,
|
||||
resizable: false,
|
||||
dialogClass: diagclass,
|
||||
title: labels[13],
|
||||
close: function(event, ui) { $('#image-annotate-error-dialog').remove(); },
|
||||
width: 450,
|
||||
buttons: btns
|
||||
});
|
||||
},
|
||||
success: function(data) {
|
||||
if (data.result == "error") {
|
||||
var errordialog = '<div id="image-annotate-error-dialog">' + data.message + '<div />';
|
||||
$('body').append(errordialog);
|
||||
var btns = {};
|
||||
if (rtlsupport == "") {
|
||||
diagclass = "inmage-annotate-dialog";
|
||||
} else {
|
||||
diagclass = "inmage-annotate-dialog-rtl";
|
||||
}
|
||||
btns[labels[14]] = function(){
|
||||
$('#image-annotate-error-dialog').remove();
|
||||
};
|
||||
$('#image-annotate-error-dialog').dialog({
|
||||
modal: true,
|
||||
resizable: false,
|
||||
dialogClass: diagclass,
|
||||
title: labels[13],
|
||||
close: function(event, ui) { $('#image-annotate-error-dialog').remove(); },
|
||||
width: 450,
|
||||
buttons: btns
|
||||
});
|
||||
} else {
|
||||
if (data.annotationid != "") {
|
||||
var legendid = "photoannotation-legend-" + data.oldtype;
|
||||
$("#" + legendid + "-" + data.oldid).remove();
|
||||
if ($("#" + legendid + " > span").size() == 0) {
|
||||
$("#" + legendid).hide();
|
||||
}
|
||||
$("#" + data.annotationid).remove();
|
||||
$("#" + data.annotationid + "-edit").remove();
|
||||
$("#" + data.annotationid + "-delete").remove();
|
||||
$("#" + data.annotationid + "-note").remove();
|
||||
}
|
||||
editable.description = data.description;
|
||||
editable.editable = data.editable;
|
||||
editable.height = data.height;
|
||||
editable.internaltext = data.internaltext;
|
||||
editable.left = data.left;
|
||||
editable.noteid = data.noteid;
|
||||
editable.notetype = data.notetype;
|
||||
editable.text = data.text;
|
||||
editable.top = data.top;
|
||||
editable.url = data.url;
|
||||
editable.width = data.width;
|
||||
|
||||
var anchor_open = "";
|
||||
var anchor_close = "";
|
||||
if (data.url != "") {
|
||||
anchor_open = '<a href="' + data.url + '">';
|
||||
anchor_close = '</a>';
|
||||
}
|
||||
legendid = "photoannotation-legend-" + data.notetype;
|
||||
$("#" + legendid).show();
|
||||
$("#" + legendid).append('<span id="' + legendid + '-' + data.noteid + '">' + anchor_open + data.text + anchor_close + ' </span>');
|
||||
note = new $.fn.annotateView(image, editable, image.tags, image.labels, image.editable, image.csrf, image.deleteUrl, image.saveUrl, image.cssaclass, image.rtlsupport, image.users);
|
||||
}
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
image.mode = 'view';
|
||||
|
||||
form.submit();
|
||||
|
||||
editable.destroy();
|
||||
editable.destroy();
|
||||
|
||||
});
|
||||
editable.form.append(ok);
|
||||
editable.form.append(ok);
|
||||
};
|
||||
|
||||
$.fn.annotateImage.createCancelButton = function(editable, image, rtlsupport, labels) {
|
||||
@ -174,7 +268,6 @@
|
||||
cancel.click(function() {
|
||||
editable.destroy();
|
||||
image.mode = 'view';
|
||||
location.reload();
|
||||
});
|
||||
editable.form.append(cancel);
|
||||
};
|
||||
@ -209,8 +302,8 @@
|
||||
newNote.noteid = "new";
|
||||
newNote.top = 30;
|
||||
newNote.left = 30;
|
||||
newNote.width = 30;
|
||||
newNote.height = 30;
|
||||
newNote.width = 60;
|
||||
newNote.height = 60;
|
||||
newNote.text = "";
|
||||
newNote.description = "";
|
||||
newNote.notetype = "";
|
||||
@ -242,7 +335,7 @@
|
||||
} else {
|
||||
notetitle = this.note.text;
|
||||
}
|
||||
var form = $('<div id="image-annotate-edit-form" class="ui-dialog-content ui-widget-content ' + rtlsupport + '"><form id="photoannotation-form" action="' + saveUrl + '" method="post"><input type="hidden" name="csrf" value="' + csrf + '" /><input type="hidden" name="noteid" value="' + this.note.noteid + '" /><input type="hidden" name="notetype" value="' + this.note.notetype + '" /><fieldset><legend>' + labels[12] + '</legend><label for="photoannotation-user-list">' + labels[10] + '</label><input id="photoannotation-user-list" class="textbox ui-corner-left ui-corner-right" type="text" name="userlist" style="width: 210px;" value="' + username + '" /><div style="text-align: center"><strong>' + labels[4] + '</strong></div><label for="image-annotate-tag-text">' + labels[0] + '</label><input id="image-annotate-tag-text" class="textbox ui-corner-left ui-corner-right" type="text" name="tagsList" style="width: 210px;" value="' + selectedtag + '" /><div style="text-align: center"><strong>' + labels[4] + '</strong></div><label for="image-annotate-text">' + labels[1] + '</label><input id="image-annotate-text" class="textbox ui-corner-left ui-corner-right" type="text" name="text" style="width: 210px;" value="' + notetitle + '" /></fieldset><fieldset><legend>' + labels[2] + '</legend><textarea id="image-annotate-desc" name="desc" rows="3" style="width: 210px;">' + this.note.description + '</textarea></fieldset</form></div>');
|
||||
var form = $('<div id="image-annotate-edit-form" class="ui-dialog-content ui-widget-content ' + rtlsupport + '"><form id="photoannotation-form" action="' + saveUrl + '" method="post"><input id="photoannotation-csrf" type="hidden" name="csrf" value="' + csrf + '" /><input id="photoannotation-noteid" type="hidden" name="noteid" value="' + this.note.noteid + '" /><input id="photoannotation-notetype" type="hidden" name="notetype" value="' + this.note.notetype + '" /><fieldset><legend>' + labels[12] + '</legend><label for="photoannotation-user-list">' + labels[10] + '</label><input id="photoannotation-user-list" class="textbox ui-corner-left ui-corner-right" type="text" name="userlist" style="width: 210px;" value="' + username + '" /><div style="text-align: center"><strong>' + labels[4] + '</strong></div><label for="image-annotate-tag-text">' + labels[0] + '</label><input id="image-annotate-tag-text" class="textbox ui-corner-left ui-corner-right" type="text" name="tagsList" style="width: 210px;" value="' + selectedtag + '" /><div style="text-align: center"><strong>' + labels[4] + '</strong></div><label for="image-annotate-text">' + labels[1] + '</label><input id="image-annotate-text" class="textbox ui-corner-left ui-corner-right" type="text" name="text" style="width: 210px;" value="' + notetitle + '" /></fieldset><fieldset><legend>' + labels[2] + '</legend><textarea id="image-annotate-desc" name="desc" rows="3" style="width: 210px;">' + this.note.description + '</textarea></fieldset></form></div>');
|
||||
this.form = form;
|
||||
$('body').append(this.form);
|
||||
$("#photoannotation-form").ready(function() {
|
||||
@ -267,30 +360,24 @@
|
||||
if ($("input#image-annotate-tag-text").val() != "") {
|
||||
$("input#image-annotate-text").html("");
|
||||
$("input#image-annotate-text").val("");
|
||||
$("input#image-annotate-text").text("");
|
||||
$("input#photoannotation-user-list").html("");
|
||||
$("input#photoannotation-user-list").val("");
|
||||
$("input#photoannotation-user-list").text("");
|
||||
}
|
||||
});
|
||||
$("input#image-annotate-text").keyup(function() {
|
||||
if ($("input#image-annotate-text").val() != "") {
|
||||
$("input#image-annotate-tag-text").html("");
|
||||
$("input#image-annotate-tag-text").val("");
|
||||
$("input#image-annotate-tag-text").text("");
|
||||
$("input#photoannotation-user-list").html("");
|
||||
$("input#photoannotation-user-list").val("");
|
||||
$("input#photoannotation-user-list").text("");
|
||||
}
|
||||
});
|
||||
$("input#photoannotation-user-list").keyup(function() {
|
||||
if ($("select#photoannotation-user-list").val() != "-1") {
|
||||
$("input#image-annotate-tag-text").html("");
|
||||
$("input#image-annotate-tag-text").val("");
|
||||
$("input#image-annotate-tag-text").text("");
|
||||
$("input#image-annotate-text").html("");
|
||||
$("input#image-annotate-text").val("");
|
||||
$("input#image-annotate-text").text("");
|
||||
}
|
||||
});
|
||||
this.form.css('left', this.area.offset().left + 'px');
|
||||
@ -351,16 +438,12 @@
|
||||
image.canvas.children('.image-annotate-view').prepend(this.area);
|
||||
|
||||
if (editable) {
|
||||
this.delarea = $('<div class="image-annotate-area photoannotation-del-button"><div><form id="photoannotation-del-' + this.note.noteid + '" class="photoannotation-del-form" method="post" action="' + deleteUrl + '"><input type="hidden" name="notetype" value="' + this.note.notetype + '" /><input type="hidden" name="noteid" value="' + this.note.noteid + '" /><input type="hidden" name="csrf" value="' + csrf + '" /></form></div></div>');
|
||||
this.editarea = $('<div id="photoannotation-edit-' + this.note.noteid + '" class="image-annotate-area photoannotation-edit-button"><div></div></div>');
|
||||
this.delarea = $('<div id="photoannotation-area-' + this.note.notetype + "-" + this.note.noteid + '-delete" class="image-annotate-area photoannotation-del-button" rel="photoannotation-area-' + this.note.notetype + "-" + this.note.noteid + '"><div><form id="photoannotation-area-' + this.note.notetype + "-" + this.note.noteid + '-del-form" class="photoannotation-del-form" method="post" action="' + deleteUrl + '"><input type="hidden" name="notetype" value="' + this.note.notetype + '" /><input type="hidden" name="noteid" value="' + this.note.noteid + '" /><input type="hidden" name="csrf" value="' + csrf + '" /></form></div></div>');
|
||||
this.editarea = $('<div id="photoannotation-area-' + this.note.notetype + "-" + this.note.noteid + '-edit" class="image-annotate-area photoannotation-edit-button"><div></div></div>');
|
||||
image.canvas.children('.image-annotate-view').prepend(this.delarea);
|
||||
image.canvas.children('.image-annotate-view').prepend(this.editarea);
|
||||
this.delarea.bind('click',function () {
|
||||
var alink = $(cssaclass);
|
||||
alink.unbind();
|
||||
alink.attr ('href', '#');
|
||||
alink.removeAttr ('rel');
|
||||
var confdialog = '<div id="image-annotate-conf-dialog" rel="' + $(this).find('form.photoannotation-del-form').attr('id') + '">' + labels[3] + '<div />';
|
||||
var confdialog = '<div id="image-annotate-conf-dialog" rel="' + $(this).attr('rel') + '">' + labels[3] + '<div />';
|
||||
$('body').append(confdialog);
|
||||
var btns = {};
|
||||
if (rtlsupport == "") {
|
||||
@ -368,23 +451,64 @@
|
||||
} else {
|
||||
diagclass = "inmage-annotate-dialog-rtl";
|
||||
}
|
||||
btns[labels[5]] = function(){ var delform = $(this).attr("rel"); $("form#" + delform).submit(); };
|
||||
btns[labels[6]] = function(){ location.reload(); };
|
||||
btns[labels[5]] = function(){
|
||||
var delform = $("#" + $(this).attr("rel") + "-del-form");
|
||||
$.ajax({
|
||||
url: deleteUrl,
|
||||
type: 'POST',
|
||||
data: delform.serialize(),
|
||||
error: function(e) {
|
||||
var errordialog = '<div id="image-annotate-error-dialog">' + labels[15] + '<div />';
|
||||
$('body').append(errordialog);
|
||||
var btns = {};
|
||||
if (rtlsupport == "") {
|
||||
diagclass = "inmage-annotate-dialog";
|
||||
} else {
|
||||
diagclass = "inmage-annotate-dialog-rtl";
|
||||
}
|
||||
btns[labels[14]] = function(){
|
||||
$('#image-annotate-error-dialog').remove();
|
||||
};
|
||||
$('#image-annotate-error-dialog').dialog({
|
||||
modal: true,
|
||||
resizable: false,
|
||||
dialogClass: diagclass,
|
||||
title: labels[13],
|
||||
close: function(event, ui) { $('#image-annotate-error-dialog').remove(); },
|
||||
width: 450,
|
||||
buttons: btns
|
||||
});
|
||||
},
|
||||
success: function(data) {
|
||||
if (data.result == "success") {
|
||||
var annotationid = "photoannotation-area-" + data.notetype + "-" + data.noteid;
|
||||
var legendid = "photoannotation-legend-" + data.notetype;
|
||||
$("#" + legendid + "-" + data.noteid).remove();
|
||||
if ($("#" + legendid + " > span").size() == 0) {
|
||||
$("#" + legendid).hide();
|
||||
}
|
||||
$("#" + annotationid).remove();
|
||||
$("#" + annotationid + "-edit").remove();
|
||||
$("#" + annotationid + "-delete").remove();
|
||||
$("#" + annotationid + "-note").remove();
|
||||
}
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
$('#image-annotate-conf-dialog').remove();
|
||||
};
|
||||
btns[labels[6]] = function(){ $('#image-annotate-conf-dialog').remove(); };
|
||||
$('#image-annotate-conf-dialog').dialog({
|
||||
modal: true,
|
||||
resizable: false,
|
||||
dialogClass: diagclass,
|
||||
title: labels[7],
|
||||
close: function(event, ui) { location.reload(); },
|
||||
close: function(event, ui) { $('#image-annotate-conf-dialog').remove(); },
|
||||
buttons: btns
|
||||
});
|
||||
});
|
||||
var form = this;
|
||||
this.editarea.bind('click',function () {
|
||||
var alink = $(cssaclass);
|
||||
alink.unbind();
|
||||
alink.attr ('href', '#');
|
||||
alink.removeAttr ('rel');
|
||||
form.edit(tags, labels, saveUrl, csrf, rtlsupport, users);
|
||||
});
|
||||
this.delarea.hide();
|
||||
@ -396,7 +520,7 @@
|
||||
if (note.description != "") {
|
||||
notedescription = "<br />" + note.description;
|
||||
}
|
||||
this.form = $('<div class="image-annotate-note">' + note.text + notedescription + '</div>');
|
||||
this.form = $('<div id="photoannotation-area-' + this.note.notetype + "-" + this.note.noteid + '-note" class="image-annotate-note">' + note.text + notedescription + '</div>');
|
||||
this.form.hide();
|
||||
image.canvas.children('.image-annotate-view').append(this.form);
|
||||
this.form.children('span.actions').hide();
|
||||
@ -453,10 +577,6 @@
|
||||
// Edit a note feature
|
||||
if (note.url != "" && note.url != null) {
|
||||
this.area.bind('click',function () {
|
||||
var alink = $(cssaclass);
|
||||
alink.unbind();
|
||||
alink.attr ('href', '#');
|
||||
alink.removeAttr ('rel');
|
||||
window.location = note.url;
|
||||
});
|
||||
}
|
||||
@ -479,6 +599,7 @@
|
||||
this.delarea.css('top', (this.note.top) + 'px');
|
||||
this.editarea.children('div').height('14px');
|
||||
this.editarea.children('div').width('14px');
|
||||
this.editarea.css('top', (this.note.top + 16) + 'px');
|
||||
if (rtlsupport == '') {
|
||||
this.delarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px');
|
||||
this.editarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px');
|
||||
@ -486,7 +607,6 @@
|
||||
this.delarea.css('left', (this.note.left - 16) + 'px');
|
||||
this.editarea.css('left', (this.note.left - 16) + 'px');
|
||||
}
|
||||
this.editarea.css('top', (this.note.top + 16) + 'px');
|
||||
}
|
||||
};
|
||||
|
||||
@ -529,23 +649,11 @@
|
||||
|
||||
// Create/prepare the editable note elements
|
||||
var editable = new $.fn.annotateEdit(this.image, this.note, tags, labels, saveUrl, csrf, rtlsupport, users);
|
||||
$.fn.annotateImage.createSaveButton(editable, this.image, annotation, rtlsupport, labels);
|
||||
$.fn.annotateImage.createSaveButton(editable, this.image, annotation, rtlsupport, labels, saveUrl);
|
||||
$.fn.annotateImage.createCancelButton(editable, this.image, rtlsupport, labels);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.annotateImage.appendPosition = function(form, editable) {
|
||||
/// <summary>
|
||||
/// Appends the annotations coordinates to the given form that is posted to the server.
|
||||
/// </summary>
|
||||
var areaFields = $('<input type="hidden" value="' + editable.area.height() + '" name="height"/>' +
|
||||
'<input type="hidden" value="' + editable.area.width() + '" name="width"/>' +
|
||||
'<input type="hidden" value="' + editable.area.position().top + '" name="top"/>' +
|
||||
'<input type="hidden" value="' + editable.area.position().left + '" name="left"/>' +
|
||||
'<input type="hidden" value="' + editable.note.id + '" name="id"/>');
|
||||
form.append(areaFields);
|
||||
};
|
||||
|
||||
$.fn.annotateView.prototype.resetPosition = function(editable, text) {
|
||||
/// <summary>
|
||||
/// Sets the position of an annotation.
|
||||
@ -571,4 +679,16 @@
|
||||
this.editable = true;
|
||||
};
|
||||
|
||||
$.fn.annotateImage.appendPosition = function(form, editable) {
|
||||
/// <summary>
|
||||
/// Appends the annotations coordinates to the given form that is posted to the server.
|
||||
/// </summary>
|
||||
var areaFields = $('<input type="hidden" value="' + editable.area.height() + '" name="height"/>' +
|
||||
'<input type="hidden" value="' + editable.area.width() + '" name="width"/>' +
|
||||
'<input type="hidden" value="' + editable.area.position().top + '" name="top"/>' +
|
||||
'<input type="hidden" value="' + editable.area.position().left + '" name="left"/>' +
|
||||
'<input type="hidden" value="' + editable.note.id + '" name="id"/>');
|
||||
form.append(areaFields);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
@ -22,6 +22,7 @@
|
||||
$jscode = "";
|
||||
$legend_faces = "";
|
||||
$legend_notes = "";
|
||||
$legend_users = "";
|
||||
if (module::get_var("gallery", "active_site_theme") == "greydragon") {
|
||||
$css_item_id = "#g-photo-id-". $item->id;
|
||||
$css_a_class = ".g-sb-preview";
|
||||
@ -42,7 +43,7 @@
|
||||
$user_text = $oneTag->name;
|
||||
}
|
||||
if ($showusers) {
|
||||
$legend_users .= "<span id=\"photoannotation-legend-user-". $oneUser->id . "\"><a href=\"". user_profile::url($oneUser->user_id) ."\">". html::clean($user_text) ."</a></span>, ";
|
||||
$legend_users .= "<span id=\"photoannotation-legend-user-". $oneUser->id . "\"><a href=\"". user_profile::url($oneUser->user_id) ."\">". html::clean($user_text) ."</a></span> ";
|
||||
}
|
||||
$jscode .= "{ \"top\": ". $oneUser->y1 .",\n";
|
||||
$jscode .= "\"left\": ". $oneUser->x1 .",\n";
|
||||
@ -57,15 +58,16 @@
|
||||
$jscode .= "\"url\": \"". user_profile::url($oneUser->user_id) ."\" },\n";
|
||||
}
|
||||
}
|
||||
$display = "none";
|
||||
if ($legend_users != "") {
|
||||
$legend_users = trim($legend_users, ", ");
|
||||
$legend_users = t("Users on this photo: ") . $legend_users;
|
||||
$display = "block";
|
||||
}
|
||||
$legend_users = t("<span id=\"photoannotation-legend-user\" style=\"display: ". $display ."\">People on this photo: ") . $legend_users ."</span>";
|
||||
foreach ($existingFaces as $oneFace) {
|
||||
$oneTag = ORM::factory("tag", $oneFace->tag_id);
|
||||
if ($oneTag->loaded()) {
|
||||
if ($showfaces) {
|
||||
$legend_faces .= "<span id=\"photoannotation-legend-face-". $oneFace->id . "\"><a href=\"". $oneTag->url() ."\">". html::clean($oneTag->name) ."</a></span>, ";
|
||||
$legend_faces .= "<span id=\"photoannotation-legend-face-". $oneFace->id . "\"><a href=\"". $oneTag->url() ."\">". html::clean($oneTag->name) ."</a></span> ";
|
||||
}
|
||||
$jscode .= "{ \"top\": ". $oneFace->y1 .",\n";
|
||||
$jscode .= "\"left\": ". $oneFace->x1 .",\n";
|
||||
@ -79,13 +81,14 @@
|
||||
$jscode .= "\"url\": \"". $oneTag->url() ."\" },\n";
|
||||
}
|
||||
}
|
||||
$display = "none";
|
||||
if ($legend_faces != "") {
|
||||
$legend_faces = trim($legend_faces, ", ");
|
||||
$legend_faces = t("Faces on this photo: ") . $legend_faces;
|
||||
$display = "block";
|
||||
}
|
||||
$legend_faces = t("<span id=\"photoannotation-legend-face\" style=\"display: ". $display ."\">Faces on this photo: ") . $legend_faces ."</span>";
|
||||
foreach ($existingNotes as $oneNote) {
|
||||
if ($shownotes) {
|
||||
$legend_notes .= "<span id=\"photoannotation-legend-note-". $oneNote->id . "\">". html::clean($oneNote->title) ."</span>, ";
|
||||
$legend_notes .= "<span id=\"photoannotation-legend-note-". $oneNote->id . "\">". html::clean($oneNote->title) ."</span> ";
|
||||
}
|
||||
$jscode .= "{ \"top\": ". $oneNote->y1 .",\n";
|
||||
$jscode .= "\"left\": ". $oneNote->x1 .",\n";
|
||||
@ -100,17 +103,14 @@
|
||||
}
|
||||
$jscode = trim($jscode, ",\n");
|
||||
$jscode .= " ],";
|
||||
$display = "none";
|
||||
if ($legend_notes != "") {
|
||||
$legend_notes = trim($legend_notes, ", ");
|
||||
$legend_notes = t("Notes on this photo: ") . $legend_notes;
|
||||
$display = "block";
|
||||
}
|
||||
$legend_notes = t("<span id=\"photoannotation-legend-note\" style=\"display: ". $display ."\">Notes on this photo: ") . $legend_notes ."</span>";
|
||||
}
|
||||
$legend_display = "";
|
||||
if ($legend_users != "" || $legend_faces != "" || $legend_notes != "") {
|
||||
$legend_display = $legend_users . "<br />" . $legend_faces . "<br />" . $legend_notes;
|
||||
$legend_display = str_replace("<br /><br />", "<br />", $legend_display);
|
||||
}
|
||||
$labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("User:") ."','". t("No user selected") ."','". t("Select one of the following") ."' ],";
|
||||
$legend_display = $legend_users . $legend_faces . $legend_notes;
|
||||
$labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."','". t("View fullsize") ."' ],";
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
@ -133,6 +133,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<? if ($legend_display != ""): ?>
|
||||
<?= "<div style=\"text-align: center\">". $legend_display ."</div>" ?>
|
||||
<? endif ?>
|
||||
<?= "<div id=\"photoannotation-legend\" class=\"g-breadcrumbs\" style=\"text-align: center\">". $legend_display ."</div>" ?>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<?= $search_form ?>
|
||||
<? if (count($users)): ?>
|
||||
<div class="g-message photoannotation-user-search">
|
||||
<?= t("%count users found for <b>%term</b>", array("count" => $count, "term" => $q)) ?>
|
||||
<?= t("%count people found for <b>%term</b>", array("count" => $count, "term" => $q)) ?>
|
||||
</div>
|
||||
<? foreach ($users as $user): ?>
|
||||
<? $profile_link = "<a href=\"". user_profile::url($user->id) ."\">" ?>
|
||||
@ -52,4 +52,4 @@
|
||||
<?= t("No users found for <b>%term</b>", array("term" => $q)) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
29
modules/tag_it/controllers/tag_it.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2010 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
class Tag_It_Controller extends Controller {
|
||||
public function tags_for($id) {
|
||||
$item = ORM::factory("item", $id);
|
||||
access::required("view", $item);
|
||||
|
||||
$view = new View("tag_it_tags_for.html");
|
||||
$view->tags = tag::item_tags($item);
|
||||
print $view;
|
||||
}
|
||||
}
|
67
modules/tag_it/helpers/tag_it_block.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2010 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
class tag_it_block_Core {
|
||||
static function get_site_list() {
|
||||
return array("untagged_photo" => t("Tag it"));
|
||||
}
|
||||
|
||||
static function get($block_id, $theme) {
|
||||
if (identity::active_user()->guest) {
|
||||
return;
|
||||
}
|
||||
|
||||
$block = "";
|
||||
switch ($block_id) {
|
||||
case "untagged_photo":
|
||||
$attempts = 0;
|
||||
do {
|
||||
$item = item::random_query()
|
||||
->join("items_tags", "items.id", "items_tags.item_id", "left")
|
||||
->where("items.type", "!=", "album")
|
||||
->where("items_tags.item_id", "IS", null)
|
||||
->find_all(1)
|
||||
->current();
|
||||
} while (!$item && $attempts++ < 3);
|
||||
if ($item && $item->loaded()) {
|
||||
$block = new Block();
|
||||
$block->css_id = "g-tag-it-block";
|
||||
$block->title = t("Tag it");
|
||||
$block->content = new View("tag_it_block.html");
|
||||
$block->content->item = $item;
|
||||
|
||||
$form = new Forge("tags/create/{$item->id}", "", "post",
|
||||
array("id" => "g-tag-it-add-tag-form", "class" => "g-short-form"));
|
||||
$label = $item->is_album() ?
|
||||
t("Add tag to album") :
|
||||
($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie"));
|
||||
|
||||
$group = $form->group("add_tag")->label("Add Tag");
|
||||
$group->input("name")->label($label)->rules("required")->id("name");
|
||||
$group->hidden("item_id")->value($item->id);
|
||||
$group->submit("")->value(t("Add Tag"));
|
||||
|
||||
$block->content->form = $form;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $block;
|
||||
}
|
||||
}
|
3
modules/tag_it/module.info
Normal file
@ -0,0 +1,3 @@
|
||||
name = "Tag It"
|
||||
description = "Present an untagged photo and ask the user to tag it."
|
||||
version = 1
|
28
modules/tag_it/views/tag_it_block.html.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<script type="text/javascript">
|
||||
$("#g-tag-it-add-tag-form").ready(function() {
|
||||
$("#g-tag-it-add-tag-form input:text").autocomplete(
|
||||
"<?= url::site("tags/autocomplete") ?>", {
|
||||
max: 30,
|
||||
multiple: true,
|
||||
multipleSeparator: ',',
|
||||
cacheLength: 1,
|
||||
selectFirst: false,
|
||||
}
|
||||
);
|
||||
$("#g-tag-it-add-tag-form").ajaxForm({
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#g-tag-it-add-tag-form").resetForm();
|
||||
$("#g-tag-it-tags-container").load("<?= url::site("tag_it/tags_for/{$item->id}") ?>");
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="g-tag-it-block">
|
||||
<a href="<?= $item->url() ?>">
|
||||
<?= $item->thumb_img(array("class" => "g-thumbnail")) ?>
|
||||
</a>
|
||||
<p id="g-tag-it-tags-container"></p>
|
||||
<?= $form ?>
|
||||
</div>
|
6
modules/tag_it/views/tag_it_tags_for.html.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<?= t("Tags:") ?>
|
||||
<? $i = 0 ?>
|
||||
<? foreach ($tags as $tag): ?>
|
||||
<?= (++$i != 1) ? ", " : " " ?>
|
||||
<a href="<?= url::site("tag/{$tag->name}") ?>"><?= $tag->name ?></a><? endforeach ?>
|
@ -16,7 +16,6 @@
|
||||
<?= $theme->css("yui/reset-fonts-grids.css") ?>
|
||||
<?= $theme->css("themeroller/ui.base.css") ?>
|
||||
<?= $theme->css("superfish/css/superfish.css") ?>
|
||||
<?= $theme->css("gallery.common.css") ?>
|
||||
<?= $theme->css("screen.css") ?>
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="<?= $theme->url("fix-ie.css") ?>"
|
||||
|
BIN
modules/themeroller/data/images/loading-large.gif
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
modules/themeroller/data/images/loading-small.gif
Normal file
After Width: | Height: | Size: 673 B |
@ -27,7 +27,6 @@
|
||||
<?= $theme->css("yui/reset-fonts-grids.css") ?>
|
||||
<?= $theme->css("superfish/css/superfish.css") ?>
|
||||
<?= $theme->css("themeroller/ui.base.css") ?>
|
||||
<?= $theme->css("gallery.common.css") ?>
|
||||
<?= $theme->css("screen.css") ?>
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
|
||||
|
@ -117,6 +117,7 @@ class themeroller {
|
||||
$parameters["views"] = $is_admin ? glob(MODPATH . "themeroller/data/admin_views/*.html.php") :
|
||||
glob(MODPATH . "themeroller/data/views/*.html.php");
|
||||
$parameters["css_files"] = $css_files;
|
||||
$parameters["gifs"] = glob(MODPATH . "themeroller/data/images/*.gif");
|
||||
$parameters["images"] =
|
||||
glob("$css_path/development-bundle/themes/$original_name/images/ui-bg*.png");
|
||||
$thumb_dir = $is_admin ? "admin_thumbnail" : "site_thumbnail";
|
||||
|
@ -51,6 +51,7 @@ class themeroller_task_Core {
|
||||
+ count($parameters["masks"]) // number of images to generate
|
||||
+ count($parameters["icons"]) // number of icon images to generate
|
||||
+ count($parameters["css_files"]) // number of css files
|
||||
+ count($parameters["gifs"]) // number of static files
|
||||
+ count($parameters["images"])); // number of image files to copy
|
||||
|
||||
$task->status = t("Starting up");
|
||||
@ -101,6 +102,23 @@ class themeroller_task_Core {
|
||||
|
||||
if (empty($parameters["views"])){
|
||||
$task->status = t("Themeroller images copied");
|
||||
$task->set("mode", "copy_gif_images");
|
||||
}
|
||||
break;
|
||||
case "copy_gif_images":
|
||||
$task->status = t("Copying gif images");
|
||||
while (!empty($parameters["gifs"]) && microtime(true) - $start < 1.5) {
|
||||
$gif = array_shift($parameters["gifs"]);
|
||||
$target = "{$theme_path}images/" . basename($gif);
|
||||
if (!file_exists($target)) {
|
||||
copy($gif, $target);
|
||||
$task->log(t("Copied gif image: %path", array("path" => basename($gif))));
|
||||
}
|
||||
$completed++;
|
||||
}
|
||||
|
||||
if (empty($parameters["gifs"])){
|
||||
$task->status = t("Gif images copied");
|
||||
$task->set("mode", "copy_css");
|
||||
}
|
||||
break;
|
||||
|
53
modules/user_rest/helpers/user_rest.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
class user_rest_Core {
|
||||
static function get($request) {
|
||||
$user = rest::resolve($request->url);
|
||||
|
||||
return array(
|
||||
"url" => $request->url,
|
||||
"entity" => array(
|
||||
"display_name" => $user->display_name()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
static function resolve($id) {
|
||||
$user = identity::lookup_user($id);
|
||||
|
||||
if (!self::_can_view_profile_pages($user)) {
|
||||
throw new Kohana_404_Exception();
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
||||
static function _can_view_profile_pages($user) {
|
||||
if (!$user->loaded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($user->id == identity::active_user()->id) {
|
||||
// You can always view your own profile
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (module::get_var("gallery", "show_user_profiles_to")) {
|
||||
case "admin_users":
|
||||
return identity::active_user()->admin;
|
||||
|
||||
case "registered_users":
|
||||
return !identity::active_user()->guest;
|
||||
|
||||
case "everybody":
|
||||
return true;
|
||||
|
||||
default:
|
||||
// Fail in private mode on an invalid setting
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
3
modules/user_rest/module.info
Normal file
@ -0,0 +1,3 @@
|
||||
name = "REST User Resource"
|
||||
description = "Provides access to user names via the RESTful API"
|
||||
version = 1.1
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
// Initialize Superfish menus
|
||||
$("#g-site-admin-menu .g-menu").hide().addClass("sf-menu");
|
||||
$("#g-site-admin-menu .g-menu").superfish({
|
||||
@ -54,7 +54,9 @@ $(document).ready(function(){
|
||||
$(".g-available .g-block").addClass("ui-corner-all");
|
||||
$(".g-unavailable").addClass("ui-corner-all");
|
||||
|
||||
// Remove titles for menu options since we're displaying that text anyway
|
||||
$(".sf-menu a, .sf-menu li").removeAttr("title");
|
||||
|
||||
// Initialize button hover effect
|
||||
$.fn.gallery_hover_init();
|
||||
|
||||
});
|
||||
|
@ -43,6 +43,9 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
// Remove titles for menu options since we're displaying that text anyway
|
||||
$(".sf-menu a, .sf-menu li").removeAttr("title");
|
||||
|
||||
// Album and search results views
|
||||
if ($("#g-album-grid").length) {
|
||||
// Set equal height for album items and vertically align thumbnails/metadata
|
||||
@ -87,9 +90,18 @@ $(document).ready(function() {
|
||||
$(this).css("top", 0).css("left", 0);
|
||||
// Remove the placeholder and hover class from the item
|
||||
$(this).removeClass("g-hover-item");
|
||||
$(this).gallery_valign();
|
||||
$("#g-place-holder").remove();
|
||||
}
|
||||
);
|
||||
|
||||
// Realign any thumbnails that change so that when we rotate a thumb it stays centered.
|
||||
$(".g-item").bind("gallery.change", function() {
|
||||
$(".g-item").each(function() {
|
||||
$(this).height($(this).find("img").height() + 2);
|
||||
});
|
||||
$(".g-item").equal_heights().gallery_valign();
|
||||
});
|
||||
}
|
||||
|
||||
// Photo/Item item view
|
||||
|
@ -4,10 +4,23 @@
|
||||
<!-- Use javascript to show the full size as an overlay on the current page -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
full_dims = [<?= $theme->item()->width ?>, <?= $theme->item()->height ?>];
|
||||
$(".g-fullsize-link").click(function() {
|
||||
$.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>");
|
||||
$.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, full_dims[0], full_dims[1]);
|
||||
return false;
|
||||
});
|
||||
|
||||
// After the image is rotated or replaced we have to reload the image dimensions
|
||||
// so that the full size view isn't distorted.
|
||||
$("#g-photo").bind("gallery.change", function() {
|
||||
$.ajax({
|
||||
url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>",
|
||||
dataType: "json",
|
||||
success: function(data, textStatus) {
|
||||
full_dims = data.full;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<? endif ?>
|
||||
|
@ -649,7 +649,7 @@ div#g-action-status {
|
||||
}
|
||||
|
||||
.g-warning {
|
||||
background: #fcf9ce url('../../../lib/images/ico-warning.png') no-repeat .4em 50%;
|
||||
background: #fcf9ce url('../images/icons/ico-warning.png') no-repeat .4em 50%;
|
||||
}
|
||||
|
||||
|
||||
|
BIN
themes/sobriety/images/icons/ico-warning.png
Normal file
After Width: | Height: | Size: 666 B |
@ -8,10 +8,11 @@
|
||||
* 2) Reusable content blocks
|
||||
* 3) Page layout containers
|
||||
* 4) Content blocks in specific layout containers
|
||||
* 5) Navigation and menus
|
||||
* 6) Browser hacks
|
||||
* 7) jQuery and jQuery UI
|
||||
* 8) Right-to-left language styles
|
||||
* 5) States and interactions
|
||||
* 6) Positioning and order
|
||||
* 7) Navigation and menus
|
||||
* 8) jQuery and jQuery UI
|
||||
* 9) Right-to-left language styles
|
||||
*/
|
||||
|
||||
/** *******************************************************************
|
||||
@ -60,6 +61,8 @@ h2 {
|
||||
margin-bottom: .6em;
|
||||
}
|
||||
|
||||
#g-content,
|
||||
#g-site-menu,
|
||||
h3 {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
@ -67,6 +70,23 @@ h4 {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
#g-sidebar,
|
||||
.g-breadcrumbs {
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
#g-banner,
|
||||
#g-footer,
|
||||
.g-message {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
#g-album-grid .g-item,
|
||||
#g-item #g-photo,
|
||||
#g-item #g-movie {
|
||||
font-size: .7em;
|
||||
}
|
||||
|
||||
/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
a,
|
||||
@ -123,6 +143,9 @@ td {
|
||||
}
|
||||
|
||||
/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #ccc;
|
||||
@ -226,6 +249,87 @@ li.g-error select {
|
||||
border: 2px solid red;
|
||||
}
|
||||
|
||||
/* Forms in dialogs and panels ~~~~~~~~~ */
|
||||
|
||||
#g-dialog ul li {
|
||||
padding-bottom: .8em;
|
||||
}
|
||||
|
||||
#g-dialog fieldset,
|
||||
#g-panel fieldset {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#g-panel legend {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[readonly] {
|
||||
background-color: #F4F4FC;
|
||||
}
|
||||
|
||||
#g-dialog input.textbox,
|
||||
#g-dialog input[type=text],
|
||||
#g-dialog input[type=password],
|
||||
#g-dialog textarea {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-short-form legend,
|
||||
.g-short-form label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.g-short-form fieldset {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.g-short-form li {
|
||||
float: left;
|
||||
margin: 0 !important;
|
||||
padding: .4em 0;
|
||||
}
|
||||
|
||||
.g-short-form .textbox,
|
||||
.g-short-form input[type=text] {
|
||||
color: #666;
|
||||
padding: .3em .6em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.g-short-form .textbox.g-error {
|
||||
border: 1px solid #f00;
|
||||
color: #f00;
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
.g-short-form .g-cancel {
|
||||
display: block;
|
||||
margin: .3em .8em;
|
||||
}
|
||||
|
||||
#g-sidebar .g-short-form li {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
.g-text-small {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.g-text-big {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.g-text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/** *******************************************************************
|
||||
* 2) Reusable content blocks
|
||||
*********************************************************************/
|
||||
@ -258,6 +362,31 @@ li.g-error select {
|
||||
* 3) Page layout containers
|
||||
*********************************************************************/
|
||||
|
||||
/* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */
|
||||
.g-one-quarter {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.g-one-third {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.g-one-half {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.g-two-thirds {
|
||||
width: 66%;
|
||||
}
|
||||
|
||||
.g-three-quarters {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.g-whole {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-view {
|
||||
@ -396,6 +525,13 @@ li.g-error select {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Search results ~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
#g-content #g-search-results {
|
||||
margin-top: 1em;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
/* Individual photo content ~~~~~~~~~~~~~~ */
|
||||
|
||||
#g-content #g-item {
|
||||
@ -472,8 +608,207 @@ li.g-error select {
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
#g-edit-permissions-form td {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#g-edit-permissions-form fieldset {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#g-permissions .g-denied {
|
||||
background-color: #fcc;
|
||||
}
|
||||
|
||||
#g-permissions .g-allowed {
|
||||
background-color: #cfc;
|
||||
}
|
||||
|
||||
#g-permissions .g-breadcrumbs a {
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
#g-permissions .g-active a {
|
||||
border: 1px solid #ddd;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
/** *******************************************************************
|
||||
* 5) Navigation and menus
|
||||
* 5) States and interactions
|
||||
**********************************************************************/
|
||||
|
||||
.g-active,
|
||||
.g-enabled,
|
||||
.g-available,
|
||||
.g-selected,
|
||||
.g-highlight {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.g-inactive,
|
||||
.g-disabled,
|
||||
.g-unavailable,
|
||||
.g-uneditable,
|
||||
.g-locked,
|
||||
.g-deselected,
|
||||
.g-understate {
|
||||
color: #ccc;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.g-editable {
|
||||
padding: .2em .3em;
|
||||
}
|
||||
|
||||
.g-editable:hover {
|
||||
background-color: #ffc;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.g-error,
|
||||
.g-info,
|
||||
.g-success,
|
||||
.g-warning {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
form li.g-error,
|
||||
form li.g-info,
|
||||
form li.g-success,
|
||||
form li.g-warning {
|
||||
background-image: none;
|
||||
padding: .3em .8em .3em 0;
|
||||
}
|
||||
|
||||
.g-short-form li.g-error {
|
||||
padding: .3em 0;
|
||||
}
|
||||
|
||||
form.g-error input[type="text"],
|
||||
li.g-error input[type="text"],
|
||||
form.g-error input[type="password"],
|
||||
li.g-error input[type="password"],
|
||||
form.g-error input[type="checkbox"],
|
||||
li.g-error input[type="checkbox"],
|
||||
form.g-error input[type="radio"],
|
||||
li.g-error input[type="radio"],
|
||||
form.g-error textarea,
|
||||
li.g-error textarea,
|
||||
form.g-error select,
|
||||
li.g-error select {
|
||||
border: 2px solid #f00;
|
||||
margin-bottom: .2em;
|
||||
}
|
||||
|
||||
.g-error,
|
||||
.g-denied,
|
||||
tr.g-error td.g-error,
|
||||
#g-add-photos-status .g-error {
|
||||
background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%;
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.g-info {
|
||||
background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%;
|
||||
}
|
||||
|
||||
.g-success,
|
||||
.g-allowed,
|
||||
#g-add-photos-status .g-success {
|
||||
background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%;
|
||||
}
|
||||
|
||||
tr.g-success {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
tr.g-success td.g-success {
|
||||
background-image: url('../images/ico-success.png');
|
||||
}
|
||||
|
||||
.g-warning,
|
||||
tr.g-warning td.g-warning {
|
||||
background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%;
|
||||
}
|
||||
|
||||
form .g-error {
|
||||
background-color: #fff;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.g-open {
|
||||
}
|
||||
|
||||
.g-closed {
|
||||
}
|
||||
|
||||
.g-installed {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
.g-default {
|
||||
background-color: #c5dbec;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.g-draggable {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.g-draggable:hover {
|
||||
border: 1px dashed #000;
|
||||
}
|
||||
|
||||
.ui-sortable .g-target,
|
||||
.ui-state-highlight {
|
||||
background-color: #fcf9ce;
|
||||
border: 2px dotted #999;
|
||||
height: 2em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-loading-large,
|
||||
.g-dialog-loading-large {
|
||||
background: #e8e8e8 url('../images/loading-large.gif') no-repeat center center !important;
|
||||
}
|
||||
|
||||
.g-loading-small {
|
||||
background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center !important;
|
||||
}
|
||||
|
||||
/** *******************************************************************
|
||||
* 6) Positioning and order
|
||||
**********************************************************************/
|
||||
|
||||
.g-left {
|
||||
clear: none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.g-right {
|
||||
clear: none;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.g-first {
|
||||
}
|
||||
|
||||
.g-last {
|
||||
}
|
||||
|
||||
.g-even {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.g-odd {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
/** *******************************************************************
|
||||
* 7 Navigation and menus
|
||||
*********************************************************************/
|
||||
|
||||
#g-site-menu,
|
||||
@ -652,11 +987,34 @@ li.g-error select {
|
||||
}
|
||||
|
||||
/** *******************************************************************
|
||||
* 6) jQuery and jQuery UI
|
||||
* 8) jQuery and jQuery UI
|
||||
*********************************************************************/
|
||||
/* Generic block container ~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-block {
|
||||
clear: both;
|
||||
margin-bottom: 2.5em;
|
||||
}
|
||||
|
||||
.g-block-content {
|
||||
}
|
||||
|
||||
/* Superfish menu overrides ~~~~~~~~~~~~~~ */
|
||||
|
||||
.sf-menu ul {
|
||||
width: 12em;
|
||||
}
|
||||
|
||||
ul.sf-menu li li:hover ul,
|
||||
ul.sf-menu li li.sfHover ul {
|
||||
left: 12em;
|
||||
}
|
||||
|
||||
ul.sf-menu li li li:hover ul,
|
||||
ul.sf-menu li li li.sfHover ul {
|
||||
left: 12em;
|
||||
}
|
||||
|
||||
.sf-menu a {
|
||||
border-left: 1px solid #e8e8e8;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
@ -689,6 +1047,27 @@ li.g-error select {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-button {
|
||||
display: inline-block;
|
||||
margin: 0 4px 0 0;
|
||||
padding: .2em .4em;
|
||||
}
|
||||
|
||||
.g-button,
|
||||
.g-button:hover,
|
||||
.g-button:active {
|
||||
cursor: pointer !important;
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
-moz-outline-style: none;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 2px 4px 2px 4px;
|
||||
}
|
||||
|
||||
/* jQuery UI ThemeRoller buttons */
|
||||
|
||||
.g-buttonset {
|
||||
@ -721,6 +1100,122 @@ li.g-error select {
|
||||
background-position: -208px -64px;
|
||||
}
|
||||
|
||||
.g-progress-bar {
|
||||
height: 1em;
|
||||
width: 100%;
|
||||
margin-top: .5em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Status and validation messages ~~~~ */
|
||||
|
||||
.g-message-block {
|
||||
background-position: .4em .3em;
|
||||
border: 1px solid #ccc;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#g-action-status {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#g-action-status li,
|
||||
p#g-action-status,
|
||||
div#g-action-status {
|
||||
padding: .3em .3em .3em 30px;
|
||||
}
|
||||
|
||||
#g-site-status li {
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: .3em .3em .3em 30px;
|
||||
}
|
||||
|
||||
.g-module-status {
|
||||
clear: both;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.g-message {
|
||||
background-position: 0 50%;
|
||||
}
|
||||
|
||||
/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-breadcrumbs {
|
||||
clear: both;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.g-breadcrumbs li {
|
||||
background: transparent url('../images/ico-separator.gif') no-repeat scroll left center;
|
||||
float: left;
|
||||
padding: 1em 8px 1em 18px;
|
||||
}
|
||||
|
||||
.g-breadcrumbs .g-first {
|
||||
background: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.g-breadcrumbs li a,
|
||||
.g-breadcrumbs li span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#g-dialog ul.g-breadcrumbs {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.g-paginator {
|
||||
padding: .2em 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.g-paginator li {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.g-paginator .g-info {
|
||||
background: none;
|
||||
padding: .2em 0;
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
#g-dialog {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#g-dialog legend {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#g-dialog .g-cancel {
|
||||
margin: .4em 1em;
|
||||
}
|
||||
|
||||
#g-panel {
|
||||
display: none;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
/* Inline layout ~~~~~~~~~~ */
|
||||
|
||||
.g-inline li {
|
||||
float: left;
|
||||
margin-left: 1.8em;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.g-inline li.g-first {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* STUFF THAT NEEDS A HOME */
|
||||
|
||||
#g-move ul {
|
||||
@ -761,6 +1256,11 @@ li.g-error select {
|
||||
background-color: #cfc;
|
||||
}
|
||||
|
||||
/* Autocomplete ~~~~~~~~~~ */
|
||||
.ac_loading {
|
||||
background: white url('../images/loading-small.gif') right center no-repeat !important;
|
||||
}
|
||||
|
||||
/*************** STUFF THAT NEEDS A HOME ****************/
|
||||
|
||||
#g-admin-g2-import-notes {
|
||||
@ -794,12 +1294,326 @@ li.g-error select {
|
||||
list-style-type: disc;
|
||||
}
|
||||
|
||||
/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */
|
||||
/** *******************************************************************
|
||||
* 9) Right to left language styles
|
||||
*********************************************************************/
|
||||
|
||||
.rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.rtl #g-header,
|
||||
.rtl #g-content,
|
||||
.rtl #g-sidebar,
|
||||
.rtl #g-footer,
|
||||
.rtl caption,
|
||||
.rtl th,
|
||||
.rtl #g-dialog,
|
||||
.rtl .g-context-menu li a,
|
||||
.rtl .g-message-box li,
|
||||
.rtl #g-site-status li {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .g-text-right {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.rtl .g-error,
|
||||
.rtl .g-info,
|
||||
.rtl .g-success,
|
||||
.rtl .g-warning,
|
||||
.rtl #g-add-photos-status .g-success,
|
||||
.rtl #g-add-photos-status .g-error {
|
||||
background-position: center right;
|
||||
padding-right: 30px !important;
|
||||
}
|
||||
|
||||
.rtl form li.g-error,
|
||||
.rtl form li.g-info,
|
||||
.rtl form li.g-success,
|
||||
.rtl form li.g-warning {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.rtl .g-left,
|
||||
.rtl .g-inline li,
|
||||
.rtl #g-content #g-album-grid .g-item,
|
||||
.rtl .sf-menu li,
|
||||
.rtl .g-breadcrumbs li,
|
||||
.rtl .g-paginator li,
|
||||
.rtl .g-buttonset li,
|
||||
.rtl .ui-icon-left .ui-icon,
|
||||
.rtl .g-short-form li,
|
||||
.rtl form ul ul li,
|
||||
.rtl input[type="submit"],
|
||||
.rtl input[type="reset"],
|
||||
.rtl input.checkbox,
|
||||
.rtl input[type=checkbox],
|
||||
.rtl input.radio,
|
||||
.rtl input[type=radio] {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.rtl .g-right,
|
||||
.rtl .ui-icon-right .ui-icon {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rtl .g-inline li {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.rtl .g-inline li.g-first {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.rtl .g-breadcrumbs li {
|
||||
background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center;
|
||||
padding: 1em 18px 1em 8px;
|
||||
}
|
||||
|
||||
.rtl .g-breadcrumbs .g-first {
|
||||
background: none;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.rtl input.checkbox {
|
||||
margin-left: .4em;
|
||||
}
|
||||
|
||||
.rtl #g-add-comment {
|
||||
right: inherit;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.rtl .ui-icon-left .ui-icon {
|
||||
margin-left: .2em;
|
||||
}
|
||||
|
||||
.rtl .ui-icon-right .ui-icon {
|
||||
margin-right: .2em;
|
||||
}
|
||||
|
||||
/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
.rtl .g-buttonset .ui-corner-tl {
|
||||
-moz-border-radius-topleft: 0;
|
||||
-webkit-border-top-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
-moz-border-radius-topright: 5px !important;
|
||||
-webkit-border-top-right-radius: 5px !important;
|
||||
border-top-right-radius: 5px !important;
|
||||
}
|
||||
|
||||
.rtl .g-buttonset .ui-corner-tr {
|
||||
-moz-border-radius-topright: 0;
|
||||
-webkit-border-top-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
-moz-border-radius-topleft: 5px !important;
|
||||
-webkit-border-top-left-radius: 5px !important;
|
||||
border-top-left-radius: 5px !important;
|
||||
}
|
||||
|
||||
.rtl .g-buttonset .ui-corner-bl {
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
-moz-border-radius-bottomright: 5px !important;
|
||||
-webkit-border-bottom-right-radius: 5px !important;
|
||||
border-bottom-right-radius: 5px !important;
|
||||
}
|
||||
|
||||
.rtl .g-buttonset .ui-corner-br {
|
||||
-moz-border-radius-bottomright: 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
-moz-border-radius-bottomleft: 5px !important;
|
||||
-webkit-border-bottom-left-radius: 5px !important;
|
||||
border-bottom-left-radius: 5px !important;
|
||||
}
|
||||
|
||||
.rtl .g-buttonset .ui-corner-right,
|
||||
.rtl .ui-progressbar .ui-corner-right {
|
||||
-moz-border-radius-topright: 0;
|
||||
-webkit-border-top-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
-moz-border-radius-topleft: 5px !important;
|
||||
-webkit-border-top-left-radius: 5px !important;
|
||||
border-top-left-radius: 5px !important;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
-moz-border-radius-bottomleft: 5px !important;
|
||||
-webkit-border-bottom-left-radius: 5px !important;
|
||||
border-bottom-left-radius: 5px !important;
|
||||
}
|
||||
|
||||
.rtl .g-buttonset .ui-corner-left,
|
||||
.rtl .ui-progressbar .ui-corner-left {
|
||||
-moz-border-radius-topleft: 0;
|
||||
-webkit-border-top-left-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
-moz-border-radius-topright: 5px !important;
|
||||
-webkit-border-top-right-radius: 5px !important;
|
||||
border-top-right-radius: 5px !important;
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
-moz-border-radius-bottomright: 5px !important;
|
||||
-webkit-border-bottom-right-radius: 5px !important;
|
||||
border-bottom-right-radius: 5px !important;
|
||||
}
|
||||
|
||||
/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.rtl .sf-menu a {
|
||||
border-left: none;
|
||||
border-right:1px solid #fff;
|
||||
}
|
||||
|
||||
.rtl .sf-menu a.sf-with-ul {
|
||||
padding-left: 2.25em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
.rtl .sf-sub-indicator {
|
||||
left: .75em !important;
|
||||
right: auto;
|
||||
background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
|
||||
}
|
||||
.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */
|
||||
top: .8em;
|
||||
background-position: -10px -100px; /* use translucent arrow for modern browsers*/
|
||||
}
|
||||
/* apply hovers to modern browsers */
|
||||
.rtl a:focus > .sf-sub-indicator,
|
||||
.rtl a:hover > .sf-sub-indicator,
|
||||
.rtl a:active > .sf-sub-indicator,
|
||||
.rtl li:hover > a > .sf-sub-indicator,
|
||||
.rtl li.sfHover > a > .sf-sub-indicator {
|
||||
background-position: 0 -100px; /* arrow hovers for modern browsers*/
|
||||
}
|
||||
|
||||
/* point right for anchors in subs */
|
||||
.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; }
|
||||
.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; }
|
||||
/* apply hovers to modern browsers */
|
||||
.rtl .sf-menu ul a:focus > .sf-sub-indicator,
|
||||
.rtl .sf-menu ul a:hover > .sf-sub-indicator,
|
||||
.rtl .sf-menu ul a:active > .sf-sub-indicator,
|
||||
.rtl .sf-menu ul li:hover > a > .sf-sub-indicator,
|
||||
.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator {
|
||||
background-position: 0 0; /* arrow hovers for modern browsers*/
|
||||
}
|
||||
|
||||
.rtl .sf-menu li:hover ul,
|
||||
.rtl .sf-menu li.sfHover ul {
|
||||
right: 0;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.rtl ul.sf-menu li li:hover ul,
|
||||
.rtl ul.sf-menu li li.sfHover ul {
|
||||
right: 12em; /* match ul width */
|
||||
left: auto;
|
||||
}
|
||||
.rtl ul.sf-menu li li li:hover ul,
|
||||
.rtl ul.sf-menu li li li.sfHover ul {
|
||||
right: 12em; /* match ul width */
|
||||
left: auto;
|
||||
}
|
||||
|
||||
/*** shadows for all but IE6 ***/
|
||||
.rtl .sf-shadow ul {
|
||||
background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left;
|
||||
padding: 0 0 9px 8px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
-moz-border-radius-topright: 0;
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-webkit-border-top-right-radius: 0;
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
-moz-border-radius-topleft: 17px;
|
||||
-moz-border-radius-bottomright: 17px;
|
||||
-webkit-border-top-left-radius: 17px;
|
||||
-webkit-border-bottom-right-radius: 17px;
|
||||
border-top-left-radius: 17px;
|
||||
border-bottom-right-radius: 17px;
|
||||
}
|
||||
|
||||
/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.rtl .ui-dialog .ui-dialog-titlebar {
|
||||
padding: 0.5em 1em 0.3em 0.3em;
|
||||
}
|
||||
|
||||
.rtl .ui-dialog .ui-dialog-title {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.rtl .ui-dialog .ui-dialog-titlebar-close {
|
||||
left: 0.3em;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
|
||||
/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
.rtl .g-paginator .g-info {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.rtl .g-paginator .g-text-right {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.rtl .g-paginator .ui-icon-seek-end {
|
||||
background-position: -80px -160px;
|
||||
}
|
||||
|
||||
.rtl .g-paginator .ui-icon-seek-next {
|
||||
background-position: -48px -160px;
|
||||
}
|
||||
|
||||
.rtl .g-paginator .ui-icon-seek-prev {
|
||||
background-position: -32px -160px;
|
||||
}
|
||||
|
||||
.rtl .g-paginator .ui-icon-seek-first {
|
||||
background-position: -64px -160px;
|
||||
}
|
||||
|
||||
.rtl #g-header #g-login-menu,
|
||||
.rtl #g-header #g-quick-search-form {
|
||||
clear: left;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rtl #g-header #g-login-menu li {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 1.2em;
|
||||
}
|
||||
|
||||
.rtl #g-site-menu {
|
||||
left: auto;
|
||||
right: 150px;
|
||||
}
|
||||
|
||||
.rtl #g-view-menu #g-slideshow-link {
|
||||
background-image: url('../images/ico-view-slideshow-rtl.png');
|
||||
}
|
||||
|
||||
.rtl #g-sidebar .g-block-content {
|
||||
padding-right: 1em;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.rtl #g-footer #g-credits li {
|
||||
padding-left: 1.2em !important;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.rtl caption,
|
||||
.rtl th,
|
||||
.rtl #g-dialog {
|
||||
|
BIN
themes/three_nids/images/ico-denied-inactive.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
themes/three_nids/images/ico-denied-passive.png
Normal file
After Width: | Height: | Size: 916 B |
BIN
themes/three_nids/images/ico-denied.png
Normal file
After Width: | Height: | Size: 715 B |
BIN
themes/three_nids/images/ico-error.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
themes/three_nids/images/ico-info.png
Normal file
After Width: | Height: | Size: 778 B |
BIN
themes/three_nids/images/ico-lock.png
Normal file
After Width: | Height: | Size: 749 B |
BIN
themes/three_nids/images/ico-separator-rtl.gif
Normal file
After Width: | Height: | Size: 106 B |
BIN
themes/three_nids/images/ico-separator.gif
Normal file
After Width: | Height: | Size: 106 B |
BIN
themes/three_nids/images/ico-success-inactive.png
Normal file
After Width: | Height: | Size: 476 B |
BIN
themes/three_nids/images/ico-success-passive.png
Normal file
After Width: | Height: | Size: 617 B |
BIN
themes/three_nids/images/ico-success.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
themes/three_nids/images/ico-view-slideshow-rtl.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
themes/three_nids/images/ico-warning.png
Normal file
After Width: | Height: | Size: 666 B |
BIN
themes/three_nids/images/loading-large.gif
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
themes/three_nids/images/loading-small.gif
Normal file
After Width: | Height: | Size: 673 B |
@ -33,7 +33,6 @@
|
||||
<?= $theme->css("yui/reset-fonts-grids.css") ?>
|
||||
<?= $theme->css("superfish/css/superfish.css") ?>
|
||||
<?= $theme->css("themeroller/ui.base.css") ?>
|
||||
<?= $theme->css("gallery.common.css") ?>
|
||||
<?= $theme->css("jquery.fancybox.css") ?>
|
||||
<?= $theme->css("screen.css") ?>
|
||||
<?= $theme->css("three_nids.css") ?>
|
||||
|