Compare commits

..
190 changed files with 4424 additions and 7670 deletions

No files matched your search

-1
View File
@@ -18,7 +18,6 @@ gem 'kaminari'
gem 'time_difference'
gem "acts_as_unvlogable"
gem 'youtube_it'
gem 'gotcha'
# gem "memcached", "~> 1.4.3"
# gem "memcache-client"
+1 -1
View File
@@ -5,7 +5,7 @@
// the compiled file.
//
//= require jquery
//= require cycle2
//= require mobile/jquery.cycle.all
//= require mobile/jquery.mu.image.resize
//= require mobile/orbit.mobile
//= require mobile/jquery.mobile-1.2.0.min
@@ -1,21 +0,0 @@
$(function() {
$.pageslide.closeCallback(function(pageslide, item) {
$("tr").removeClass("active");
pageslide.find('.preview').cycle('destroy')
});
$.pageslide.loadComplete(function(pageslide, item) {
$("tr").removeClass("active");
item.closest('tr').addClass('active');
if(item.data('id') == 'new') {
resetForm();
pageslide.find('form').attr('action', '/admin/ad_banners/');
pageslide.find('form').attr('method', 'post');
}
else {
setForm(item.data('form'));
pageslide.find('form').attr('action', '/admin/ad_banners/' + item.data('id'));
pageslide.find('form').attr('method', 'put');
}
setSlideshow(pageslide.find('.preview'), item.data());
});
})
@@ -1,19 +0,0 @@
$(function() {
$.pageslide.closeCallback(function(pageslide, item) {
$("tr").removeClass("active");
});
$.pageslide.loadComplete(function(pageslide, item) {
$("tr").removeClass("active");
item.closest('tr').addClass('active');
if(item.data('id') == 'new') {
resetForm();
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/');
pageslide.find('form').attr('method', 'post');
}
else {
setForm(item.data('form'));
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/' + item.data('id'));
pageslide.find('form').attr('method', 'put');
}
});
})
+1 -18
View File
@@ -1,18 +1 @@
//= require lib/tags
$(function() {
$.pageslide.closeCallback(function(pageslide, item) {
$('.filter-item').removeClass("active");
});
$.pageslide.loadComplete(function(pageslide, item) {
$('.filter-item').removeClass("active");
item.closest('li').addClass('active');
if(item.hasClass('btn')) {
addTagsTab();
$('#filter-default-tag').fastLiveFilter('.add-default-tags-list', '.filter-item', '.tag');
$('.tags-groups').cardCheck({
item: '.card',
});
};
});
})
//= require admin/tags
+1 -21
View File
@@ -1,21 +1 @@
//= require lib/tags
$(function() {
$.pageslide.closeCallback(function(pageslide, item) {
$('.filter-item').removeClass("active");
});
$.pageslide.loadComplete(function(pageslide, item) {
$('.filter-item').removeClass("active");
item.closest('li').addClass('active');
if(item.data('id') == 'new') {
resetForm();
pageslide.find('form').attr('action', '/admin/tags/');
pageslide.find('form').attr('method', 'post');
}
else {
setForm(item.data('form'));
pageslide.find('form').attr('action', '/admin/tags/' + item.data('id'));
pageslide.find('form').attr('method', 'put');
}
});
})
//= require lib/tags
+20 -11
View File
@@ -473,14 +473,6 @@ if($.support.touch) {
// }
// }
};
$.fn.delayKeyup = function(callback, ms){
var timer = 0;
$(this).keyup(function(){
clearTimeout (timer);
timer = setTimeout(callback, ms);
});
return $(this);
};
}(window.jQuery);
@@ -504,8 +496,25 @@ var ini = function() {
// Open Slide
function openSlide() {
var $openSlide = $('.open-slide');
typeof customOpenSlide === 'function' ? customOpenSlide($openSlide) : $openSlide.pageslide();
var $openSlide = $('.open-slide'),
$pageslideW;
$(window).width() > 1440 ? $pageslideW = 1024 : $pageslideW = 954;
$(window).resize(function() {
$(this).width() > 1440 ? $pageslideW = 1024 : $pageslideW = 954;
})
if($('.item-groups').length) {
$os = $openSlide.not('.view-page');
$vp = $openSlide.filter('.view-page.open-slide');
$os.pageslide({ W: 624 });
$vp.pageslide({ W: $pageslideW, iframe: true });
} else {
$openSlide.pageslide();
};
$('.bottomnav .open-slide').on('click', function() {
$('.table tr').removeClass('active');
$('.filter-item').removeClass('active')
});
}
function formTip() {
@@ -540,7 +549,7 @@ function changeStatusHidden() {
// Document Ready
$(function() {
new ini();
$('#main-wrap').on('click', '.delete', function() {
$('.delete').on('click', function() {
api.modal($(this).attr('rel'));
})
initialState();
-4
View File
@@ -1,4 +0,0 @@
//= require lib/cycle2/jquery.cycle2.min.js
//= require lib/cycle2/transition/jquery.cycle2.flip.min.js
//= require lib/cycle2/transition/jquery.cycle2.scrollVert.min.js
//= require lib/cycle2/transition/jquery.cycle2.tile.min.js
+21 -18
View File
@@ -1,30 +1,33 @@
var banners = [];
var banner_index = 0;
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){
$(this).html("App setting Failed");
}else{
ajax_load_proc($(this),$(this).attr("path"));
}
if($(this).attr("path")==''){$(this).html("App setting Failed");}
if($(this).attr("path")!=''){
ajax_load_proc($(this),$(this).attr("path"));
}
}
);
$("#main_content").addClass("module");
});
$("#main_content").addClass("module");
});
function ajax_load_proc(wapper,url,isBanner){
function ajax_load_proc(wapper,url){
$.get(encodeURI(url), {}, function(respText,textSta,XML){
if (textSta == 'success') {
wapper.html(respText);
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
if (textSta == 'success') {
wapper.html(respText);
};
if(textSta == 'error')
wapper.html("Loading Failed<br/> <a href='"+$(this).attr('path')+"'>Go See</a>");
});
}
// Ad Banner FX code [start]
function getTimeout() {
return $(this).attr('time_to_next');
}
$(document).ready(function() {
$(document).on('click', '.orbit-cycle-slideshow img', function()
$(document).on('click', '.slideshow img', function()
{
if($(this).attr('link_url')!='')
{
@@ -1,82 +1,79 @@
function slideshow (element, bannerEffect, bannerTime, bannerSpeed) {
element.cycle('destroy');
element.children('img').removeAttr('style');
element.cycle({
fx: bannerEffect,
timeout: bannerTime,
speed: bannerSpeed,
});
};
function setSlideshow(element, data) {
$("#pageslide .ad_banner_ad_fx").children('option:selected').each(function(index, el) {
$(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide();
});
element.cycle('destroy');
slideshow(element, data['fx'], 2000, 1000);
}
$(function() {
var bannerEffect,
bannerTime,
bannerSpeed,
bannerW,
bannerH;
function preview() {
$(".ad_banner_ad_fx").change(function () {
bannerTime = $("#pageslide #timeout").val()*1000;
bannerSpeed = $("#pageslide #speed").val()*1000;
bannerTime = parseInt(bannerTime) || 300;
bannerSpeed = parseInt(bannerSpeed) || 300;
slideshow($(this).val(), bannerTime, bannerSpeed);
});
slideshow = function (bannerEffect, bannerTime, bannerSpeed) {
var $preview = $('#pageslide .preview'),
$previewImg = $('#pageslide .preview img');
$preview.cycle('destroy');
$previewImg.removeAttr('style');
$preview.cycle({
fx: bannerEffect,
timeout: bannerTime,
speed: bannerSpeed,
});
}
$('.open-slide').on('click', function() {
var $preview = $('#pageslide .preview'),
$data = $(this).data(),
effect = $data.fx,
time = $data.time,
speed = $data.speed,
W = $data.w,
H = $data.h;
$("#pageslide #timeout").attr("value", time/1000);
$("#pageslide #speed").attr("value", speed/1000);
$("#pageslide #banner_width").attr("value", W);
$("#pageslide #banner_height").attr("value", H);
$("#pageslide #ad_banner_ad_fx option").each(function(i) {
if($(this).attr("value") == effect) {
this.selected = true;
}
});
slideshow(effect, time, speed)
})
$('.open-modal').on('click', function() {
var _data = $(this).data();
bannerName = _data.name;
bannerEffect = _data.fx;
bannerTime = _data.time;
bannerSpeed = _data.speed;
bannerW = _data.w;
bannerH = _data.h;
var $data = $(this).data()
bannerEffect = $data.fx;
bannerTime = $data.time;
bannerSpeed = $data.speed;
bannerW = $data.w;
bannerH = $data.h;
$('#preview').modal('show');
});
$('#preview').on('shown', function() {
$(this).attr('aria-labelledby', bannerName.toString()).find('h3').text(bannerName.toString())
if(bannerW > 500) {
var resize = 500/bannerW
bannerW = Math.floor(bannerW*resize);
bannerH = Math.floor(bannerH*resize);
console.log(bannerW)
};
if(bannerH > 300) {
var resize = 300/bannerH
bannerW = Math.floor(bannerW*resize);
bannerH = Math.floor(bannerH*resize);
}
slideshow($(this).find('.preview'), bannerEffect, bannerTime, bannerSpeed);
$(this).find('.preview').css({
'width': bannerW,
'height': bannerH
});
$(this).find('.preview img').css({
'width': '100%',
'height': '100%'
$(this).find('.preview').cycle({
fx: bannerEffect,
timeout: bannerTime,
speed: bannerSpeed,
fit: 1,
width: bannerW,
height: bannerH,
});
});
$('#preview').on('hidden', function() {
$(this).attr('aria-labelledby', '').find('h3').text('')
$(this).find('.preview').cycle('destroy');
$(this).find('.preview img').removeAttr('style');
});
};
$(function() {
var bannerName = null,
bannerEffect = null,
bannerTime = null,
bannerSpeed = null,
bannerW = null,
bannerH = null,
$preview = $('#pageslide .preview');
$(".ad_banner_ad_fx").change(function () {
var suckIE = false;
// bannerTime = $("#pageslide #timeout").val()*1000;
// bannerSpeed = $("#pageslide #speed").val()*1000;
bannerTime = parseInt(bannerTime) || 300;
bannerSpeed = parseInt(bannerSpeed) || 300;
$(this).children('option:selected').each(function(index, el) {
$(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide();
});
slideshow($preview, $(this).val(), 2000, 1000);
});
preview();
});
-17
View File
@@ -1,17 +0,0 @@
/*!
* jQuery Cycle2; build: v20131005
* http://jquery.malsup.com/cycle2/
* Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
*/
/*! core engine; version: 20131003 */
(function(e){"use strict";function t(e){return(e||"").toLowerCase()}var i="20131003";e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each(function(){var n,s,o,c,r=e(this),l=e.fn.cycle.log;if(!r.data("cycle.opts")){(r.data("cycle-log")===!1||i&&i.log===!1||s&&s.log===!1)&&(l=e.noop),l("--c2 init--"),n=r.data();for(var a in n)n.hasOwnProperty(a)&&/^cycle[A-Z]+/.test(a)&&(c=n[a],o=a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),l(o+":",c,"("+typeof c+")"),n[o]=c);s=e.extend({},e.fn.cycle.defaults,n,i||{}),s.timeoutId=0,s.paused=s.paused||!1,s.container=r,s._maxZ=s.maxZ,s.API=e.extend({_container:r},e.fn.cycle.API),s.API.log=l,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},r.data("cycle.opts",s),r.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}}):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e(function(){e(n.s,n.c).cycle(i)}),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort(function(){return Math.random()-.5}),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css("opacity",1).show(),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(i.pauseOnHover!==!0&&(n=e(i.pauseOnHover)),n.hover(function(){i.API.pause(!0)},function(){i.API.resume(!0)})),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(0>i._remainingTimeout||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount,c=!1;"string"==e.type(t)&&(t=e.trim(t)),e(t).each(function(){var t,n=e(this);i?s.container.prepend(n):s.container.append(n),s.slideCount++,t=s.API.buildSlideOpts(n),s.slides=i?e(n).add(s.slides):s.slides.add(n),s.API.initSlide(t,n,--s._maxZ),n.data("cycle.opts",t),s.API.trigger("cycle-slide-added",[s,t,n])}),s.API.updateView(!0),c=s._preInitialized&&2>o&&s.slideCount>=1,c&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();e=parseInt(t.startingSlide||0,10),(e>=t.slides.length||0>e)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,0>t.nextSlide&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=0>t.nextSlide-1,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,r=this.opts();return 2>r.slideCount?(r.timeoutId=0,void 0):(!e||r.busy&&!r.manualTrump||(r.API.stopTransition(),r.busy=!1,clearTimeout(r.timeoutId),r.timeoutId=0),r.busy||(0!==r.timeoutId||e)&&(n=r.slides[r.currSlide],s=r.slides[r.nextSlide],o=r.API.getSlideOpts(r.nextSlide),c=r.API.calcTx(o,e),r._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),r.nextSlide!=r.currSlide&&(e||!r.paused&&!r.hoverPaused&&r.timeout)?(r.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){r.busy=!1,r.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),r.API.trigger("cycle-after",[o,n,s,t]),r.API.queueTransition(o),r.API.updateView(!0))},r.busy=!0,c.transLine truncated
function(e){"use strict";function t(t,n){var s,o,c,r=n.autoHeight;if("container"==r)o=e(n.slides[n.currSlide]).outerHeight(),n.container.height(o);else if(n._autoHeightRatio)n.container.height(n.container.width()/n._autoHeightRatio);else if("calc"===r||"number"==e.type(r)&&r>=0){if(c="calc"===r?i(t,n):r>=n.slides.length?0:r,c==n._sentinelIndex)return;n._sentinelIndex=c,n._sentinel&&n._sentinel.remove(),s=e(n.slides[c].cloneNode(!0)),s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),s.css({position:"static",visibility:"hidden",display:"block"}).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),s.find("*").css("visibility","hidden"),n._sentinel=s}}function i(t,i){var n=0,s=-1;return i.slides.each(function(t){var i=e(this).height();i>s&&(s=i,n=t)}),n}function n(t,i,n,s){var o=e(s).outerHeight(),c=i.sync?i.speed/2:i.speed;i.container.animate({height:o},c)}function s(i,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",s),o.container.off("cycle-before",n),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0}),e(document).on("cycle-initialized",function(i,o){function c(){t(i,o)}var r,l=o.autoHeight,a=e.type(l),d=null;("string"===a||"number"===a)&&(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",s),"container"==l?o.container.on("cycle-before",n):"string"===a&&/\d+\:\d+/.test(l)&&(r=l.match(/(\d+)\:(\d+)/),r=r[1]/r[2],o._autoHeightRatio=r),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(d),d=setTimeout(c,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(c,30))})}(jQuery),/*! caption plugin for Cycle2; version: 20130306 */
function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",function(t,i,n,s){"caption"===i.captionModule&&e.each(["caption","overlay"],function(){var e=this,t=n[e+"Template"],o=i.API.getComponent(e);o.length&&t?(o.html(i.API.tmpl(t,n,i,s)),o.show()):o.hide()})}),e(document).on("cycle-destroyed",function(t,i){var n;e.each(["caption","overlay"],function(){var e=this,t=i[e+"Template"];i[e]&&t&&(n=i.API.getComponent("caption"),n.empty())})})}(jQuery),/*! command plugin for Cycle2; version: 20130707 */
function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each(function(){var r;return n=i,o=e(this).data("cycle.opts"),void 0===o?(t.log('slideshow must be initialized before sending commands; "'+n+'" ignored'),void 0):(n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?(r=e.makeArray(c),r.shift(),s.apply(o.API,r)):(t.log("unknown command: ",n),void 0))}):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;e.allowWrap===!1&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;e.allowWrap===!1&&0>e.currSlide+t||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each(function(){e(this).removeData(),i(this,"parsedAttrs",!1)})},jump:function(e){var t,i=this.opts();if(!i.busy||i.manualTrump){var n=parseInt(e,10);if(isNaN(n)||0>n||n>=i.slides.length)return i.API.log("goto: invalid slide index: "+n),void 0;if(n==i.currSlide)return i.API.log("goto: skipping, already on slide",n),void 0;i.nextSlide=n,clearTimeout(i.timeoutId),i.timeoutId=0,i.API.log("goto: ",n," (zero-index)"),t=i.currSlide<i.nextSlide,i.API.prepareTx(!0,t)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,r=0;s.slides.length>r;r++)i=s.slides[r],r==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):s.currSlide>t?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))})}(jQuery),/*! hash plugin for Cycle2; version: 20130905 */
function(e){"use strict";function t(t,i){var n;return t._hashFence?(t._hashFence=!1,void 0):(n=window.location.hash.substring(1),t.slides.each(function(s){if(e(this).data("cycle-hash")==n){if(i===!0)t.startingSlide=s;else{var o=s>t.currSlide;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}}),void 0)}e(document).on("cycle-pre-initialize",function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)}),e(document).on("cycle-update-view",function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)}),e(document).on("cycle-destroyed",function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)})}(jQuery),/*! loader plugin for Cycle2; version: 20130307 */
function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",function(t,i){function n(t,n){function o(t){var o;"wait"==i.loader?(r.push(t),0===a&&(r.sort(c),s.apply(i.API,[r,n]),i.container.removeClass("cycle-loading"))):(o=e(i.slides[i.currSlide]),s.apply(i.API,[t,n]),o.show(),i.container.removeClass("cycle-loading"))}function c(e,t){return e.data("index")-t.data("index")}var r=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var l=0;t.length>l;l++)t[l]=e(t[l])[0];t=e(t);var a=t.length;a&&(t.hide().appendTo("body").each(function(t){function c(){0===--l&&(--a,o(d))}var l=0,d=e(this),u=d.is("img")?d:d.find("img");return d.data("index",t),u=u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),u.length?(l=u.length,u.each(function(){this.complete?c():e(this).load(function(){c()}).error(function(){0===--l&&(i.API.log("slide skipped; img not loaded:",this.src),0===--a&&"wait"==i.loader&&s.apply(i.API,[r,n]))})}),void 0):(--a,r.push(d),void 0)}),a&&i.container.addClass("cycle-loading"))}var s;i.loader&&(s=i.API.add,i.API.add=n)})}(jQuery),/*! pager plugin for Cycle2; version: 20130525 */
function(e){"use strict";function t(t,i,n){var s,o=t.API.getComponent("pager");o.each(function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,function(e){e.preventDefault(),t.API.page(o,e.currentTarget)})})}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=n,o=s>i.currSlide;i.currSlide!=s&&(i.nextSlide=s,i.API.prepareTx(!0,o),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",function(e,i,n){n.buildPagerLink=t}),e(document).on("cycle-slide-added",function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)}),e(document).on("cycle-slide-removed",function(t,i,n){if(i.pager){var s=i.API.getComponent("pager");s.each(function(){var t=e(this);e(t.children()[n]).remove()})}}),e(document).on("cycle-update-view",function(t,i){var n;i.pager&&(n=i.API.getComponent("pager"),n.each(function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))}),e(document).on("cycle-destroyed",function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),/*! prevnext plugin for Cycle2; version: 20130709 */
function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",function(e,t){if(t.API.getComponent("next").on(t.nextEvent,function(e){e.preventDefault(),t.API.next()}),t.API.getComponent("prev").on(t.prevEvent,function(e){e.preventDefault(),t.API.prev()}),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(){t.API.next()}),t.container.on(n,function(){t.API.prev()})}}),e(document).on("cycle-update-view",function(e,t){if(!t.allowWrap){var i=t.disabledClass,n=t.API.getComponent("next"),s=t.API.getComponent("prev"),o=t._prevBoundry||0,c=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==c?n.addClass(i).prop("disabled",!0):n.removeClass(i).prop("disabled",!1),t.currSlide===o?s.addClass(i).prop("disabled",!0):s.removeClass(i).prop("disabled",!1)}}),e(document).on("cycle-destroyed",function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),/*! progressive loader plugin for Cycle2; version: 20130315 */
function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,r=o.prev,l=o.prepareTx,a=e.type(i.progressive);if("array"==a)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==a){if(s=e(i.progressive),n=e.trim(s.html()),!n)return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(d){return o.log("error parsing progressive slides",d),void 0}else n=n.split(RegExp(s.data("cycle-split")||"\n")),n[n.length-1]||n.pop()}l&&(o.prepareTx=function(e,t){var s,o;return e||0===n.length?(l.apply(i.API,[e,t]),void 0):(t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.API.advanceSlide(1)},50)}),i.API.add(o)):t||0!==i.currSlide?l.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.currSlide=1,t.API.advanceSlide(-1)},50)}),i.API.add(o,!0)),void 0)}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),r&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else r.apply(e.API)})}})}(jQuery),/*! tmpl plugin for Cycle2; version: 20121227 */
function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,function(t,i){var n,o,c,r,l=i.split(".");for(n=0;s.length>n;n++)if(c=s[n]){if(l.length>1)for(r=c,o=0;l.length>o;o++)c=r,r=r[l[o]]||i;else r=c[i];if(e.isFunction(r))return r.apply(c,s);if(void 0!==r&&null!==r&&r!=i)return r}return i})}})}(jQuery);
//@ sourceMappingURL=jquery.cycle2.js.map
@@ -1,2 +0,0 @@
/* Plugin for Cycle2; Copyright (c) 2012 M. Alsup; v20130909 */
(function(e){"use strict";function t(t){return{preInit:function(e){e.slides.css(n)},transition:function(i,n,s,o,r){var l=i,c=e(n),a=e(s),d=l.speed/2;t.call(a,-90),a.css({display:"block","background-position":"-90px",opacity:1}),c.css("background-position","0px"),c.animate({backgroundPosition:90},{step:t,duration:d,easing:l.easeOut||l.easing,complete:function(){i.API.updateView(!1,!0),a.animate({backgroundPosition:0},{step:t,duration:d,easing:l.easeIn||l.easing,complete:r})}})}}}function i(t){return function(i){var n=e(this);n.css({"-webkit-transform":"rotate"+t+"("+i+"deg)","-moz-transform":"rotate"+t+"("+i+"deg)","-ms-transform":"rotate"+t+"("+i+"deg)","-o-transform":"rotate"+t+"("+i+"deg)",transform:"rotate"+t+"("+i+"deg)"})}}var n,s=document.createElement("div").style,o=e.fn.cycle.transitions,r=void 0!==s.transform||void 0!==s.MozTransform||void 0!==s.webkitTransform||void 0!==s.oTransform||void 0!==s.msTransform;r&&void 0!==s.msTransform&&(s.msTransform="rotateY(0deg)",s.msTransform||(r=!1)),r?(o.flipHorz=t(i("Y")),o.flipVert=t(i("X")),n={"-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-o-backface-visibility":"hidden","backface-visibility":"hidden"}):(o.flipHorz=o.scrollHorz,o.flipVert=o.scrollVert||o.scrollHorz)})(jQuery);
@@ -1,2 +0,0 @@
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20121120 */
(function(a){function b(a,b,c){if(a&&c.style.filter){b._filter=c.style.filter;try{c.style.removeAttribute("filter")}catch(d){}}else!a&&b._filter&&(c.style.filter=b._filter)}"use strict",a.extend(a.fn.cycle.transitions,{fade:{before:function(c,d,e,f){var g=c.API.getSlideOpts(c.nextSlide).slideCss||{};c.API.stackSlides(d,e,f),c.cssBefore=a.extend(g,{opacity:0,display:"block"}),c.animIn={opacity:1},c.animOut={opacity:0},b(!0,c,e)},after:function(a,c,d){b(!1,a,d)}},fadeout:{before:function(c,d,e,f){var g=c.API.getSlideOpts(c.nextSlide).slideCss||{};c.API.stackSlides(d,e,f),c.cssBefore=a.extend(g,{opacity:1,display:"block"}),c.animOut={opacity:0},b(!0,c,e)},after:function(a,c,d){b(!1,a,d)}}})})(jQuery);
@@ -1,2 +0,0 @@
/*! Plugin for Cycle2; Copyright (c) 2012 M. Alsup; ver: 20121120 */
(function(a){"use strict",a.fn.cycle.transitions.scrollVert={before:function(a,b,c,d){a.API.stackSlides(a,b,c,d);var e=a.container.css("overflow","hidden").height();a.cssBefore={top:d?-e:e,left:0,opacity:1,display:"block"},a.animIn={top:0},a.animOut={top:d?e:-e}}}})(jQuery);
@@ -1,2 +0,0 @@
/* Plugin for Cycle2; Copyright (c) 2012 M. Alsup; v20130721 */
(function(e){"use strict";e.fn.cycle.transitions.tileSlide=e.fn.cycle.transitions.tileBlind={before:function(t,i,n,s){t.API.stackSlides(i,n,s),e(i).show(),t.container.css("overflow","hidden"),t.tileDelay=t.tileDelay||"tileSlide"==t.fx?100:125,t.tileCount=t.tileCount||7,t.tileVertical=t.tileVertical!==!1,t.container.data("cycleTileInitialized")||(t.container.on("cycle-destroyed",e.proxy(this.onDestroy,t.API)),t.container.data("cycleTileInitialized",!0))},transition:function(t,i,n,s,o){function r(e){p.eq(e).animate(I,{duration:t.speed,easing:t.easing,complete:function(){(s?v-1===e:0===e)&&t._tileAniCallback()}}),setTimeout(function(){(s?v-1!==e:0!==e)&&r(s?e+1:e-1)},t.tileDelay)}t.slides.not(i).not(n).hide();var c,l,a,d,u,p=e(),f=e(i),y=e(n),v=t.tileCount,h=t.tileVertical,g=t.container.height(),m=t.container.width();h?(l=Math.floor(m/v),d=m-l*(v-1),a=u=g):(l=d=m,a=Math.floor(g/v),u=g-a*(v-1)),t.container.find(".cycle-tiles-container").remove();var I,A={left:0,top:0,overflow:"hidden",position:"absolute",margin:0,padding:0};I=h?"tileSlide"==t.fx?{top:g}:{width:0}:"tileSlide"==t.fx?{left:m}:{height:0};var S=e('<div class="cycle-tiles-container"></div>');S.css({zIndex:f.css("z-index"),overflow:"visible",position:"absolute",top:0,left:0,direction:"ltr"}),S.insertBefore(n);for(var x=0;v>x;x++)c=e("<div></div>").css(A).css({width:v-1===x?d:l,height:v-1===x?u:a,marginLeft:h?x*l:0,marginTop:h?0:x*a}).append(f.clone().css({position:"relative",maxWidth:"none",width:f.width(),margin:0,padding:0,marginLeft:h?-(x*l):0,marginTop:h?0:-(x*a)})),p=p.add(c);S.append(p),f.hide(),y.show().css("opacity",1),r(s?0:v-1),t._tileAniCallback=function(){y.show(),f.hide(),S.remove(),o()}},stopTransition:function(e){e.container.find("*").stop(!0,!0),e._tileAniCallback&&e._tileAniCallback()},onDestroy:function(){var e=this.opts();e.container.find(".cycle-tiles-container").remove()}}})(jQuery);
+1 -248
View File
@@ -32,254 +32,8 @@ function touchSupport() {
})
}
}
function customOpenSlide() {
var $openSlide = $('.open-slide'),
$pageslideW;
$(window).width() > 1440 ? $pageslideW = 1024 : $pageslideW = 954;
$(window).resize(function() {
$(this).width() > 1440 ? $pageslideW = 1024 : $pageslideW = 954;
});
$noiFrame = $openSlide.not('.view-page');
$iFrame = $openSlide.filter('.view-page.open-slide');
$noiFrame.pageslide({
W: 314,
openFn: function(pageslide, element) {
element.addClass('active')
.closest('.item-menu')
.css('display', 'inline-block')
.closest('.navbar-inner')
.addClass('active');
},
closeFn: function(pageslide, element) {
$('.item-menu').removeAttr('style');
element.removeClass('active')
.closest('.navbar-inner')
.removeClass('active');
},
loadComplete: function(pageslide, element) {
$openSlide.removeClass('active');
$('.navbar-inner').removeClass('active');
$('.item-menu').removeAttr('style');
element.addClass('active')
.closest('.item-menu')
.css('display', 'inline-block')
.closest('.navbar-inner')
.addClass('active');
var _id = element.data('id'),
_type = element.hasClass('page') ? 'page' : 'link',
_edit = element.hasClass('edit') ? true : false;
if(_id !== 'new') {
$('#pageslide form').attr({
'action': $('#pageslide form').attr('action') + '/' + _id,
'id': 'edit_' + _type + '_' + _id
});
};
_type == 'page' ? pageSetting(element.data('id'), _edit) : '';
}
});
$iFrame.pageslide({
W: $pageslideW,
iframe: true,
openFn: function(pageslide, element) {
element.addClass('active')
.closest('.item-menu')
.css('display', 'inline-block')
.closest('.navbar-inner')
.addClass('active');
},
closeFn: function(pageslide, element) {
$('.item-menu').removeAttr('style');
element.removeClass('active')
.closest('.navbar-inner')
.removeClass('active');
$('#main-wrap').css('width', 'auto')
},
loadComplete: function(pageslide, element) {
$openSlide.removeClass('active');
$('.navbar-inner').removeClass('active');
$('.item-menu').removeAttr('style');
element.addClass('active')
.closest('.item-menu')
.css('display', 'inline-block')
.closest('.navbar-inner')
.addClass('active');
pageslide.find('.content').css('padding', 0);
}
});
}
function pageSetting(id, edit) {
$pageModule = $('#page_module_app_id'),
$pageF2E = $('#page_app_frontend_url'),
$pageDesign = $('#page_design'),
$pageTheme = $('#page_theme_id'),
$pageCategory = $('#page-category'),
$pageTags = $('#page-tags');
if(edit) {
$.ajax({
url: 'page-setting.json',
type: 'POST',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: '{"id": ' + id + '}',
cache: false,
})
.done(function(data) {
_selectData = data;
$.each(_pageData.design, function(index, val) {
$pageDesign.append('<option value="' + val.main[1] + '" ' + (val.main[1] == _selectData.design.main ? 'selected="selected"' : '') + '>' + val.main[0] + '</option>');
if(val.main[1] == _selectData.design.main) {
$.each(val.sub, function(index, val) {
$pageTheme.append('<option value="' + $(this)[1] + '" ' + ($(this)[1] == _selectData.design.sub ? 'selected="selected"' : '') + '>' + $(this)[0]+ '</option>')
});
};
});
$.each(_pageData.module, function(index, val) {
$pageModule.append('<option value="' + val.main[1] + '" ' + (val.main[1] == _selectData.module.main ? 'selected="selected"' : '') + '>' + val.main[0] + '</option>');
if(val.main[1] == _selectData.module.main) {
$.each(val.sub, function(index, val) {
$pageF2E.append('<option value="' + $(this)[1] + '" ' + ($(this)[1] == _selectData.module.sub ? 'selected="selected"' : '') + '>' + $(this)[0]+ '</option>')
});
$.each(val.category, function(index, val) {
var _arr = $.inArray($(this)[1], _selectData.module.category[1]);
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
if(!_selectData.module.category[0] && _arr !== -1) {
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
_selectData.module.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
});
$.each(val.tags, function(index, val) {
var _arr = $.inArray($(this)[1], _selectData.module.tags[1]);
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
if(!_selectData.module.tags[0] && _arr !== -1) {
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
_selectData.module.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
});
};
});
changeSetting(true);
})
.fail(function(jqXHR, textStatus) {
console.log(jqXHR.status, textStatus)
var $errorMsg = '<div class="error-cover"><div class="msg"><i class="icons-warning"></i><p>Sorry! Something is wrong</p></div></div>'
$('#pageslide .view-page').append($errorMsg);
});
} else {
$.each(_pageData.design, function(index, val) {
$pageDesign.append('<option value="' + val.main[1] + '">' + val.main[0] + '</option>');
if(index == 0) {
$.each(val.sub, function(index, val) {
$pageTheme.append('<option value="' + $(this)[1] + '">' + $(this)[0]+ '</option>')
});
};
});
$.each(_pageData.module, function(index, val) {
$pageModule.append('<option value="' + val.main[1] + '">' + val.main[0] + '</option>');
if(index == 0) {
$.each(val.sub, function(index, val) {
$pageF2E.append('<option value="' + $(this)[1] + '">' + $(this)[0]+ '</option>')
});
$.each(val.category, function(index, val) {
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
});
$.each(val.tags, function(index, val) {
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
});
};
});
changeSetting(false);
};
};
function changeSetting(boolean) {
$('#pageslide').on('change', '.change', function(event) {
var _data, _select, _subData, $subSelete;
if(event.target.id == 'page_design') {
_data = _pageData.design;
_select = boolean ? _selectData.design : null;
_subData = 'template';
$subSelete = $('#page_theme_id');
} else {
_data = _pageData.module;
_select = boolean ? _selectData.module : null;
_subData = 'module';
$subSelete = $('#page_app_frontend_url');
};
$(this).children("option:selected").each(function () {
var _val = $(this).val();
$subSelete.empty();
$.each(_data, function(index, val) {
if(_val == val.main[1]) {
$.each(val.sub, function(index, val) {
var _selected = _select && $(this)[1] == _select.sub ? 'selected="selected"' : '';
$subSelete.append('<option value="' + $(this)[1] + '" ' + _selected + '>' + $(this)[0] + '</option>');
});
if(event.target.id == 'page_module_app_id') {
$pageCategory.empty();
$pageTags.empty();
$('.select_all').prop('checked', false)
$.each(val.category, function(index, val) {
if(val !== 0) {
$('#page-category-groups').slideDown(300);
var _arr = _select ? $.inArray($(this)[1], _select.category[1]) : '';
$pageCategory.append('<label class="checkbox"><input type="checkbox" name="page[category][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
if(_select && !_select.category[0] && _arr !== -1) {
$pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
_select && _val == _select.main && _select.category[0] ? $pageCategory.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
} else {
$('#page-category-groups').slideUp(300);
}
});
$.each(val.tags, function(index, val) {
if(val !== 0) {
$('#page-tags-groups').slideDown(300);
var _arr = _select ? $.inArray($(this)[1], _select.tags[1]) : '';
$pageTags.append('<label class="checkbox"><input type="checkbox" name="page[tag][]" value="'+ $(this)[1] + '">'+ $(this)[0] +'</label>');
if(_select && !_select.tags[0] && _arr !== -1) {
$pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true);
}
_select && _val == _select.main && _select.tags[0] ? $pageTags.siblings('.checkbox').children('.select_all').prop('checked', true) : '';
} else {
$('#page-tags-groups').slideUp(300);
}
});
}
return false;
};
});
});
event.preventDefault();
});
$('#pageslide').on('change', '.checkbox-groups input[type="checkbox"]', function(event) {
if($(this).hasClass('select_all') && $(this).prop('checked')) {
$(this).closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
} else if($(this).prop('checked')) {
$(this).closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
}
event.preventDefault();
});
}
function getPageData() {
$.getJSON('page-design-module.json').done(function(data) {
_pageData = data;
});
}
$(function(){
var $pageModule = null,
$pageF2E = null,
$pageDesign = null,
$pageTheme = null,
$pageCategory = null,
$pageTags = null;
_pageData = null;
_selectData = null;
$('.sortable').nestedSortable({
handle: '.brand',
items: 'li',
@@ -315,12 +69,11 @@ $(function(){
tip();
touchSupport()
itemsQuantity();
getPageData();
});
function reloadStructure(){
$.pageslide.close();
customOpenSlide();
openSlide();
tip();
touchSupport()
itemsQuantity();
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+9
View File
@@ -0,0 +1,9 @@
/**
* jQuery.Preload - Multifunctional preloader
* Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
* Dual licensed under MIT and GPL.
* Date: 3/25/2009
* @author Ariel Flesler
* @version 1.0.8
*/
;(function($){var h=$.preload=function(c,d){if(c.split)c=$(c);d=$.extend({},h.defaults,d);var f=$.map(c,function(a){if(!a)return;if(a.split)return d.base+a+d.ext;var b=a.src||a.href;if(typeof d.placeholder=='string'&&a.src)a.src=d.placeholder;if(b&&d.find)b=b.replace(d.find,d.replace);return b||null}),data={loaded:0,failed:0,next:0,done:0,total:f.length};if(!data.total)return finish();var g=$(Array(d.threshold+1).join('<img/>')).load(handler).error(handler).bind('abort',handler).each(fetch);function handler(e){data.element=this;data.found=e.type=='load';data.image=this.src;data.index=this.index;var a=data.original=c[this.index];data[data.found?'loaded':'failed']++;data.done++;if(d.enforceCache)h.cache.push($('<img/>').attr('src',data.image)[0]);if(d.placeholder&&a.src)a.src=data.found?data.image:d.notFound||a.src;if(d.onComplete)d.onComplete(data);if(data.done<data.total)fetch(0,this);else{if(g&&g.unbind)g.unbind('load').unbind('error').unbind('abort');g=null;finish()}};function fetch(i,a,b){if(a.attachEvent&&data.next&&data.next%h.gap==0&&!b){setTimeout(function(){fetch(i,a,1)},0);return!1}if(data.next==data.total)return!1;a.index=data.next;a.src=f[data.next++];if(d.onRequest){data.index=a.index;data.element=a;data.image=a.src;data.original=c[data.next-1];d.onRequest(data)}};function finish(){if(d.onFinish)d.onFinish(data)}};h.gap=14;h.cache=[];h.defaults={threshold:2,base:'',ext:'',replace:''};$.fn.preload=function(a){h(this,a);return this}})(jQuery);
-13
View File
@@ -1,13 +0,0 @@
/**
* jQuery.Preload
* https://github.com/htmlhero/jQuery.preload
*
* Created by Andrew Motoshin
* http://htmlhero.ru
*
* Version: 1.5.0
* Requires: jQuery 1.6+
*
*/
!function(a){a.preload=function(){var b=[],c=function(a){for(var c=0;c<b.length;c++)if(b[c].src===a.src)return b[c];return b.push(a),a},d=function(a,b,c){"function"==typeof b&&b.call(a,c)};return function(b,e,f){if("undefined"!=typeof b){"string"==typeof b&&(b=[b]),2===arguments.length&&"function"==typeof e&&(f=e,e=0);var g,h=b.length;if(e>0&&h>e&&(g=b.slice(e,h),b=b.slice(0,e),h=b.length),!h)return d(b,f,!0),void 0;for(var i,j=arguments.callee,k=0,l=function(){k++,k===h&&(d(b,f,!g),j(g,e,f))},m=0;m<b.length;m++)i=new Image,i.src=b[m],i=c(i),i.complete?l():a(i).on("load error",l)}}}();var b=function(b,c){var d,e,f,g,h,i=[],j=new RegExp("url\\(['\"]?([^\"')]*)['\"]?\\)","i");return c.recursive&&(b=b.find("*").add(b)),b.each(function(){for(d=a(this),e=d.css("background-image")+","+d.css("border-image-source"),e=e.split(","),h=0;h<e.length;h++)f=e[h],-1===f.indexOf("about:blank")&&-1===f.indexOf("data:image")&&(g=j.exec(f),g&&i.push(g[1]));"IMG"===this.nodeName&&i.push(this.src)}),i};a.fn.preload=function(){var c,d;1===arguments.length?"object"==typeof arguments[0]?c=arguments[0]:d=arguments[0]:arguments.length>1&&(c=arguments[0],d=arguments[1]),c=a.extend({recursive:!0,part:0},c);var e=this,f=b(e,c);return a.preload(f,c.part,function(a){a&&"function"==typeof d&&d.call(e.get())}),this}}(jQuery);
-354
View File
@@ -1,354 +0,0 @@
!function ($) {
// Convenience vars for accessing elements
var $pageslide = $('#pageslide'),
$body = $('#main-wrap'),
$bottomNav = $('.bottomnav'),
$element;
if($pageslide.length == 0) {
var _html = '<div id="pageslide"><div class="page-title clearfix"><a class="pull-right" href="javascript:$.pageslide.close()"><i class="icons-arrow-left-2"/></a><span/></div><div class="view-page"><div class="nano"><div class="content"/></div></div></div>';
$pageslide = $(_html).css('display', 'none').appendTo( $body );
} else {
$pageslide.css('display', 'none')
}
var _sliding = false, // Mutex to assist closing only once
_lastCaller; // Used to keep track of last element to trigger pageslide
// $(window).resize(function(event) {
// if($pageslide.is(':visible')) {
// console.log("ddd")
// $pageslide.find('.nano').height($('body').height() - $('#orbit-bar').height() - $pageslide.find('.page-title').outerHeight(true));
// }
// });
function _checkTitle(settings) {
if(settings.pageTitle) {
$pageslide.find('.page-title').show().children('span').text(settings.pageTitle);
$pageslide.find('.view-page').css('top', 48);
} else {
$pageslide.find('.page-title').hide();
$pageslide.find('.view-page').css('top', 0);
}
}
function _load(settings) {
// Are we loading an element from the page or a URL?
if ( settings.href.indexOf("#") === 0 ) {
// Load a page element
var _contentHtml = $(settings.href).html();
var dtd = $.Deferred();
function appendHtml(dtd) {
$pageslide.find('.content').html(_contentHtml);
if($pageslide.find('.content').find('*').length !== 0) {
dtd.resolve();
} else {
dtd.reject();
}
return dtd;
}
$.when(appendHtml(dtd))
.done(function() {
setTimeout(function() {
$pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
}, 1);
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
})
.fail(function() {});
} else {
// Load a URL. Into an iframe?
if(settings.iframe) {
var iframe = $("<iframe />").attr({
src: settings.href,
frameborder: 0,
hspace: 0
})
.css({
width: "100%",
height: "100%"
});
$pageslide.find('.content').html(iframe).show();
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
} else {
$pageslide.find('.content').load(settings.href, function(response, status, xhr){
if(status == 'success') {
$pageslide.show();
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
$pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
} else {
var msg = '<div style="text-align: center;"><i class="icons-warning" style="font-size: 5em;"></i><h4>Oops!</h4>System may be wrong<br/> or please try again later</div>'
$pageslide.find('.content').html(msg);
}
});
}
if($pageslide.find('.error-cover').length) $pageslide.find('.error-cover').remove();
$pageslide.data( 'localEl', false );
}
_checkTitle(settings);
}
// Function that controls opening of the pageslide
function _start(settings) {
var slideWidth = $pageslide.outerWidth(true),
bodyMove = $sidebarState && !$('.item-groups').length ? slideWidth - 241 : settings.direction == 'right' ? slideWidth - 61 : slideWidth,
bodyAnimateIn = {},
bottomnavAnimateIn = {},
slideAnimateIn = {};
// If the slide is open or opening, just ignore the call
if($pageslide.is(':visible') || _sliding) return;
_sliding = true;
switch(settings.direction) {
case 'left':
$pageslide.css({left: 'auto', right: '-' + slideWidth + 'px'});
bodyAnimateIn['padding-right'] = '+=' + bodyMove;
slideAnimateIn['right'] = '+=' + slideWidth;
break;
default:
$pageslide.css({left: '-' + slideWidth + 'px', right: 'auto'});
bodyAnimateIn['margin-left'] = '+=' + bodyMove;
bottomnavAnimateIn['left'] = '+=' + bodyMove;
if($(window).width() <= 1440 && slideWidth > 963 ) {
bodyAnimateIn['width'] = $body.width();
}
slideAnimateIn['left'] = '+=' + slideWidth;
break;
}
// Animate the slide, and attach this slide's settings to the element
$body.animate(bodyAnimateIn, settings.speed);
$bottomNav.animate(bottomnavAnimateIn, settings.speed);
$pageslide.show().animate(slideAnimateIn, settings.speed, function() {
_sliding = false;
if(typeof settings.openFn === "function") {
settings.openFn.call(this, $pageslide, $element);
};
});
}
$.fn.pageslide = function(options) {
var $elements = this;
// On click
$elements.click( function(e) {
var $self = $(this),
settings = $.extend({href: $self.attr('href'), pageTitle: $self.data('title')}, options);
$element = $self;
// Prevent the default behavior and stop propagation
e.preventDefault();
e.stopPropagation();
if ($pageslide.is(':visible') && $self[0] == _lastCaller) {
// If we clicked the same element twice, toggle closed
$.pageslide.close();
} else {
// Open
$.pageslide(settings);
// Record the last element to trigger pageslide
_lastCaller = $self[0];
}
});
};
/*
* Default settings
*/
$.fn.pageslide.defaults = {
speed: 300, // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds)
direction: 'right', // Accepts 'left' or 'right'
modal: false, // If set to true, you must explicitly close pageslide using $.pageslide.close();
iframe: false, // By default, linked pages are loaded into an iframe. Set this to false if you don't want an iframe.
href: null, // Override the source of the content. Optional in most cases, but required when opening pageslide programmatically.
W: 264,
closeFn : null,
openFn : null,
loadComplete : null,
pageTitle: '',
};
/*
* Public methods
*/
// Open the pageslide
$.pageslide = function(options) {
// Extend the settings with those the user has provided
var settings = $.extend({}, $.fn.pageslide.defaults, options),
pageCss = {},
convertToFunction = function(fn){
var x = new Function();
x = fn;
return x;
};
pageCss['width'] = settings.W;
pageCss['margin-left'] = $sidebarState && !$('.item-groups').length ? 241 : settings.direction == 'right' ? 61 : 0;
// Change Object to Function
if(settings.openFn) {
$.fn.pageslide.defaults.openFn = convertToFunction(settings.openFn);
};
if(settings.closeFn) {
$.fn.pageslide.defaults.closeFn = convertToFunction(settings.closeFn);
};
if(settings.loadComplete) {
$.fn.pageslide.defaults.loadComplete = convertToFunction(settings.loadComplete);
};
// Are we trying to open in different direction?
if(($pageslide.is(':visible') && $pageslide.data('W') != settings.W) || ($pageslide.is(':visible') && $pageslide.data('direction') != settings.direction)) {
$.pageslide.close(function(){
$pageslide.css(pageCss);
_checkTitle(settings)
_load(settings);
_start(settings);
});
} else {
_checkTitle(settings)
_load(settings);
if($pageslide.is(':hidden')) {
$pageslide.css(pageCss);
_start(settings);
}
}
$pageslide.data(settings);
}
// Close the pageslide
$.pageslide.close = function(callback) {
var $pageslide = $('#pageslide'),
slideWidth = $pageslide.outerWidth(true),
bodyMove = $sidebarState && !$('.item-groups').length ? slideWidth - 241 : $.fn.pageslide.defaults.direction == 'right' ? slideWidth - 61 : slideWidth
speed = $pageslide.data('speed'),
bodyAnimateIn = {},
bottomnavAnimateIn = {},
slideAnimateIn = {};
// If the slide isn't open, just ignore the call
if( $pageslide.is(':hidden') || _sliding ) return;
_sliding = true;
switch($pageslide.data('direction')) {
case 'left':
bodyAnimateIn['padding-right'] = '-=' + bodyMove;
slideAnimateIn['right'] = '-=' + slideWidth;
break;
default:
bodyAnimateIn['margin-left'] = '-=' + bodyMove;
bottomnavAnimateIn['left'] = '-=' + bodyMove;
slideAnimateIn['left'] = '-=' + slideWidth;
break;
}
$pageslide.animate(slideAnimateIn, speed);
$bottomNav.animate(bottomnavAnimateIn, speed);
$body.animate(bodyAnimateIn, speed, function() {
if($pageslide.data('href') == '#') {
$pageslide.attr('style', '')
.hide()
.find('.content')
.attr('style', '')
.end()
.find('.view-page')
.attr('style', '')
.end()
.find('.pane')
.remove()
.end()
.find('.page-title')
.attr('style', '')
.children('span');
} else {
$pageslide.attr('style', '')
.hide()
.find('.content')
.attr('style', '')
.empty()
.end()
.find('.view-page')
.attr('style', '')
.end()
.find('.pane')
.remove()
.end()
.find('.page-title')
.attr('style', '')
.children('span')
.empty();
}
_sliding = false;
if($pageslide.find('.error-cover').length) $pageslide.find('.error-cover').remove();
if(typeof callback != 'undefined') callback();
if(typeof $.fn.pageslide.defaults.closeFn === "function") {
$.fn.pageslide.defaults.closeFn.call(this, $pageslide, $element);
};
});
}
// Close Callback
$.pageslide.closeCallback = function( callback ) {
if(typeof callback === "function"){
$.fn.pageslide.defaults.closeFn = callback;
};
};
// Open Callback
$.pageslide.openCallback = function( callback ) {
if(typeof callback === "function"){
$.fn.pageslide.defaults.openFn = callback;
};
};
//data load complete callback
$.pageslide.loadComplete = function( callback ) {
if(typeof callback === "function"){
$.fn.pageslide.defaults.loadComplete = callback;
};
};
/* Events */
// Don't let clicks to the pageslide close the window
$pageslide.click(function(e) {
e.stopPropagation();
});
// Close the pageslide if the document is clicked or the users presses the ESC key, unless the pageslide is modal
$(document).bind('click keyup', function(e) {
// If this is a keyup event, let's see if it's an ESC key
if( e.type == "keyup" && e.keyCode != 27) return;
// Make sure it's visible, and we're not modal
if( $pageslide.is( ':visible' ) && !$pageslide.data( 'modal' ) ) {
$.pageslide.close();
}
});
}(window.jQuery);
function setForm(data) {
$.each(data, function(key, value) {
switch($("#pageslide form #" + key).prop("tagName"))
{
case "INPUT":
$("#pageslide form #" + key).val(value);
break;
case "SELECT":
$("#pageslide form #" + key).val(value);
break;
}
});
}
function resetForm() {
$("#pageslide form").find("input[type=text], input[type=number], textarea")
.val("")
.end()
.find("select")
.prop('selectedIndex', 0)
.end()
.find("input[type=checkbox]")
.prop('checked', false)
.end()
.find("input[type=radio]")
.prop('checked', false);
}
+2
View File
@@ -197,6 +197,7 @@ function mergerTags() {
}
$(function() {
if($('.default-tags').length) {
// checkTagsQuantity();
checkedLength();
$('#tags-merger').on('hidden', function () {
$(this).find('.filter-item').remove();
@@ -204,4 +205,5 @@ $(function() {
} else {
checkedLength();
};
// addTagsTab();
});
-16
View File
@@ -1,16 +0,0 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require lib/jquery.preload.min.js
//= require cycle2
//= require mobile/jquery.mu.image.resize
//= require mobile/orbit.mobile
//= require mobile/jquery.mobile-1.2.0.min
//= require mobile/jquery.swipeplanes-1.2.min
//= require mobile/add2home
//= require mobile/gmAPI
//= require mobile/jquery.ui.map
-350
View File
@@ -1,350 +0,0 @@
/*!
* Add to Homescreen v2.0.4 ~ Copyright (c) 2012 Matteo Spinelli, http://cubiq.org
* Released under MIT license, http://cubiq.org/license
*/
var addToHome = (function (w) {
var nav = w.navigator,
isIDevice = 'platform' in nav && (/iphone|ipod|ipad/gi).test(nav.platform),
isIPad,
isRetina,
isSafari,
isStandalone,
OSVersion,
startX = 0,
startY = 0,
lastVisit = 0,
isExpired,
isSessionActive,
isReturningVisitor,
balloon,
overrideChecks,
positionInterval,
closeTimeout,
options = {
autostart: true, // Automatically open the balloon
returningVisitor: false, // Show the balloon to returning visitors only (setting this to true is HIGHLY RECCOMENDED)
animationIn: 'bubble', // drop || bubble || fade
animationOut: 'drop', // drop || bubble || fade
startDelay: 2000, // 2 seconds from page load before the balloon appears
lifespan: 10000, // 15 seconds before it is automatically destroyed
bottomOffset: 14, // Distance of the balloon from bottom
expire: 0, // Minutes to wait before showing the popup again (0 = always displayed)
message: '', // Customize your message or force a language ('' = automatic)
touchIcon: true, // Display the touch icon
arrow: true, // Display the balloon arrow
hookOnLoad: true, // Should we hook to onload event? (really advanced usage)
iterations: 100 // Internal/debug use
},
intl = {
ca_es: 'Per instal·lar aquesta aplicació al vostre %device premeu %icon i llavors <strong>Afegir a pantalla d\'inici</strong>.',
cs_cz: 'Pro instalaci aplikace na Váš %device, stiskněte %icon a v nabídce <strong>Přidat na plochu</strong>.',
da_dk: 'Tilføj denne side til din %device: tryk på %icon og derefter <strong>Føj til hjemmeskærm</strong>.',
de_de: 'Installieren Sie diese App auf Ihrem %device: %icon antippen und dann <strong>Zum Home-Bildschirm</strong>.',
el_gr: 'Εγκαταστήσετε αυτήν την Εφαρμογή στήν συσκευή σας %device: %icon μετά πατάτε <strong>Προσθήκη σε Αφετηρία</strong>.',
en_us: 'Install this web app on your %device: tap %icon and then <strong>Add to Home Screen</strong>.',
es_es: 'Para instalar esta app en su %device, pulse %icon y seleccione <strong>Añadir a pantalla de inicio</strong>.',
fi_fi: 'Asenna tämä web-sovellus laitteeseesi %device: paina %icon ja sen jälkeen valitse <strong>Lisää Koti-valikkoon</strong>.',
fr_fr: 'Ajoutez cette application sur votre %device en cliquant sur %icon, puis <strong>Ajouter à l\'écran d\'accueil</strong>.',
he_il: '<span dir="rtl">התקן אפליקציה זו על ה-%device שלך: הקש %icon ואז <strong>הוסף למסך הבית</strong>.</span>',
hr_hr: 'Instaliraj ovu aplikaciju na svoj %device: klikni na %icon i odaberi <strong>Dodaj u početni zaslon</strong>.',
hu_hu: 'Telepítse ezt a web-alkalmazást az Ön %device-jára: nyomjon a %icon-ra majd a <strong>Főképernyőhöz adás</strong> gombra.',
it_it: 'Installa questa applicazione sul tuo %device: premi su %icon e poi <strong>Aggiungi a Home</strong>.',
ja_jp: 'このウェブアプリをあなたの%deviceにインストールするには%iconをタップして<strong>ホーム画面に追加</strong>を選んでください。',
ko_kr: '%device에 웹앱을 설치하려면 %icon을 터치 후 "홈화면에 추가"를 선택하세요',
nb_no: 'Installer denne appen på din %device: trykk på %icon og deretter <strong>Legg til på Hjem-skjerm</strong>',
nl_nl: 'Installeer deze webapp op uw %device: tik %icon en dan <strong>Zet in beginscherm</strong>.',
pl_pl: 'Aby zainstalować tę aplikacje na %device: naciśnij %icon a następnie <strong>Dodaj jako ikonę</strong>.',
pt_br: 'Instale este web app em seu %device: aperte %icon e selecione <strong>Adicionar à Tela Inicio</strong>.',
pt_pt: 'Para instalar esta aplicação no seu %device, prima o %icon e depois o <strong>Adicionar ao ecrã principal</strong>.',
ru_ru: 'Установите это веб-приложение на ваш %device: нажмите %icon, затем <strong>Добавить в «Домой»</strong>.',
sv_se: 'Lägg till denna webbapplikation på din %device: tryck på %icon och därefter <strong>Lägg till på hemskärmen</strong>.',
th_th: 'ติดตั้งเว็บแอพฯ นี้บน %device ของคุณ: แตะ %icon และ <strong>เพิ่มที่หน้าจอโฮม</strong>',
tr_tr: '%device için bu uygulamayı kurduktan sonra %icon simgesine dokunarak <strong>Ana Ekrana Ekle</strong>yin.',
zh_cn: '您可以将此应用程式安装到您的 %device 上。请按 %icon 然后点选<strong>添加至主屏幕</strong>。',
zh_tw: '您可以將此應用程式安裝到您的 %device 上。請按 %icon 然後點選<strong>加入主畫面螢幕</strong>。'
};
function init () {
// Preliminary check, all further checks are performed on iDevices only
if ( !isIDevice ) return;
var now = Date.now(),
i;
// Merge local with global options
if ( w.addToHomeConfig ) {
for ( i in w.addToHomeConfig ) {
options[i] = w.addToHomeConfig[i];
}
}
if ( !options.autostart ) options.hookOnLoad = false;
isIPad = (/ipad/gi).test(nav.platform);
isRetina = w.devicePixelRatio && w.devicePixelRatio > 1;
isSafari = (/Safari/i).test(nav.appVersion) && !(/CriOS/i).test(nav.appVersion);
isStandalone = nav.standalone;
OSVersion = nav.appVersion.match(/OS (\d+_\d+)/i);
OSVersion = OSVersion[1] ? +OSVersion[1].replace('_', '.') : 0;
lastVisit = +w.localStorage.getItem('addToHome');
isSessionActive = w.sessionStorage.getItem('addToHomeSession');
isReturningVisitor = options.returningVisitor ? lastVisit && lastVisit + 28*24*60*60*1000 > now : true;
if ( !lastVisit ) lastVisit = now;
// If it is expired we need to reissue a new balloon
isExpired = isReturningVisitor && lastVisit <= now;
if ( options.hookOnLoad ) w.addEventListener('load', loaded, false);
else if ( !options.hookOnLoad && options.autostart ) loaded();
}
function loaded () {
w.removeEventListener('load', loaded, false);
if ( !isReturningVisitor ) w.localStorage.setItem('addToHome', Date.now());
else if ( options.expire && isExpired ) w.localStorage.setItem('addToHome', Date.now() + options.expire * 60000);
if ( !overrideChecks && ( !isSafari || !isExpired || isSessionActive || isStandalone || !isReturningVisitor ) ) return;
var icons = options.touchIcon ? document.querySelectorAll('head link[rel=apple-touch-icon],head link[rel=apple-touch-icon-precomposed]') : [],
sizes,
touchIcon = '',
closeButton,
platform = nav.platform.split(' ')[0],
language = nav.language.replace('-', '_'),
i, l;
balloon = document.createElement('div');
balloon.id = 'addToHomeScreen';
balloon.style.cssText += 'left:-9999px;-webkit-transition-property:-webkit-transform,opacity;-webkit-transition-duration:0;-webkit-transform:translate3d(0,0,0);position:' + (OSVersion < 5 ? 'absolute' : 'fixed');
// Localize message
if ( options.message in intl ) { // You may force a language despite the user's locale
language = options.message;
options.message = '';
}
if ( options.message === '' ) { // We look for a suitable language (defaulted to en_us)
options.message = language in intl ? intl[language] : intl['en_us'];
}
// Search for the apple-touch-icon
if ( icons.length ) {
for ( i = 0, l = icons.length; i < l; i++ ) {
sizes = icons[i].getAttribute('sizes');
if ( sizes ) {
if ( isRetina && sizes == '114x114' ) {
touchIcon = icons[i].href;
break;
}
} else {
touchIcon = icons[i].href;
}
}
touchIcon = '<span style="background-image:url(' + touchIcon + ')" class="addToHomeTouchIcon"></span>';
}
balloon.className = (isIPad ? 'addToHomeIpad' : 'addToHomeIphone') + (touchIcon ? ' addToHomeWide' : '');
balloon.innerHTML = touchIcon +
options.message.replace('%device', platform).replace('%icon', OSVersion >= 4.2 ? '<span class="addToHomeShare"></span>' : '<span class="addToHomePlus">+</span>') +
(options.arrow ? '<span class="addToHomeArrow"></span>' : '') +
'<span class="addToHomeClose">\u00D7</span>';
document.body.appendChild(balloon);
// Add the close action
closeButton = balloon.querySelector('.addToHomeClose');
if ( closeButton ) closeButton.addEventListener('click', clicked, false);
if ( !isIPad && OSVersion >= 6 ) window.addEventListener('orientationchange', orientationCheck, false);
setTimeout(show, options.startDelay);
}
function show () {
var duration,
iPadXShift = 208;
// Set the initial position
if ( isIPad ) {
if ( OSVersion < 5 ) {
startY = w.scrollY;
startX = w.scrollX;
} else if ( OSVersion < 6 ) {
iPadXShift = 160;
}
balloon.style.top = startY + options.bottomOffset + 'px';
balloon.style.left = startX + iPadXShift - Math.round(balloon.offsetWidth / 2) + 'px';
switch ( options.animationIn ) {
case 'drop':
duration = '0.6s';
balloon.style.webkitTransform = 'translate3d(0,' + -(w.scrollY + options.bottomOffset + balloon.offsetHeight) + 'px,0)';
break;
case 'bubble':
duration = '0.6s';
balloon.style.opacity = '0';
balloon.style.webkitTransform = 'translate3d(0,' + (startY + 50) + 'px,0)';
break;
default:
duration = '1s';
balloon.style.opacity = '0';
}
} else {
startY = w.innerHeight + w.scrollY;
if ( OSVersion < 5 ) {
startX = Math.round((w.innerWidth - balloon.offsetWidth) / 2) + w.scrollX;
balloon.style.left = startX + 'px';
balloon.style.top = startY - balloon.offsetHeight - options.bottomOffset + 'px';
} else {
balloon.style.left = '50%';
balloon.style.marginLeft = -Math.round(balloon.offsetWidth / 2) - ( w.orientation%180 && OSVersion >= 6 ? 40 : 0 ) + 'px';
balloon.style.bottom = options.bottomOffset + 'px';
}
switch (options.animationIn) {
case 'drop':
duration = '1s';
balloon.style.webkitTransform = 'translate3d(0,' + -(startY + options.bottomOffset) + 'px,0)';
break;
case 'bubble':
duration = '0.6s';
balloon.style.webkitTransform = 'translate3d(0,' + (balloon.offsetHeight + options.bottomOffset + 50) + 'px,0)';
break;
default:
duration = '1s';
balloon.style.opacity = '0';
}
}
balloon.offsetHeight; // repaint trick
balloon.style.webkitTransitionDuration = duration;
balloon.style.opacity = '1';
balloon.style.webkitTransform = 'translate3d(0,0,0)';
balloon.addEventListener('webkitTransitionEnd', transitionEnd, false);
closeTimeout = setTimeout(close, options.lifespan);
}
function manualShow (override) {
if ( !isIDevice || balloon ) return;
overrideChecks = override;
loaded();
}
function close () {
clearInterval( positionInterval );
clearTimeout( closeTimeout );
closeTimeout = null;
var posY = 0,
posX = 0,
opacity = '1',
duration = '0',
closeButton = balloon.querySelector('.addToHomeClose');
if ( closeButton ) closeButton.removeEventListener('click', close, false);
if ( !isIPad && OSVersion >= 6 ) window.removeEventListener('orientationchange', orientationCheck, false);
if ( OSVersion < 5 ) {
posY = isIPad ? w.scrollY - startY : w.scrollY + w.innerHeight - startY;
posX = isIPad ? w.scrollX - startX : w.scrollX + Math.round((w.innerWidth - balloon.offsetWidth)/2) - startX;
}
balloon.style.webkitTransitionProperty = '-webkit-transform,opacity';
switch ( options.animationOut ) {
case 'drop':
if ( isIPad ) {
duration = '0.4s';
opacity = '0';
posY = posY + 50;
} else {
duration = '0.6s';
posY = posY + balloon.offsetHeight + options.bottomOffset + 50;
}
break;
case 'bubble':
if ( isIPad ) {
duration = '0.8s';
posY = posY - balloon.offsetHeight - options.bottomOffset - 50;
} else {
duration = '0.4s';
opacity = '0';
posY = posY - 50;
}
break;
default:
duration = '0.8s';
opacity = '0';
}
balloon.addEventListener('webkitTransitionEnd', transitionEnd, false);
balloon.style.opacity = opacity;
balloon.style.webkitTransitionDuration = duration;
balloon.style.webkitTransform = 'translate3d(' + posX + 'px,' + posY + 'px,0)';
}
function clicked () {
w.sessionStorage.setItem('addToHomeSession', '1');
isSessionActive = true;
close();
}
function transitionEnd () {
balloon.removeEventListener('webkitTransitionEnd', transitionEnd, false);
balloon.style.webkitTransitionProperty = '-webkit-transform';
balloon.style.webkitTransitionDuration = '0.2s';
// We reached the end!
if ( !closeTimeout ) {
balloon.parentNode.removeChild(balloon);
balloon = null;
return;
}
// On iOS 4 we start checking the element position
if ( OSVersion < 5 && closeTimeout ) positionInterval = setInterval(setPosition, options.iterations);
}
function setPosition () {
var matrix = new WebKitCSSMatrix(w.getComputedStyle(balloon, null).webkitTransform),
posY = isIPad ? w.scrollY - startY : w.scrollY + w.innerHeight - startY,
posX = isIPad ? w.scrollX - startX : w.scrollX + Math.round((w.innerWidth - balloon.offsetWidth) / 2) - startX;
// Screen didn't move
if ( posY == matrix.m42 && posX == matrix.m41 ) return;
balloon.style.webkitTransform = 'translate3d(' + posX + 'px,' + posY + 'px,0)';
}
// Clear local and session storages (this is useful primarily in development)
function reset () {
w.localStorage.removeItem('addToHome');
w.sessionStorage.removeItem('addToHomeSession');
}
function orientationCheck () {
balloon.style.marginLeft = -Math.round(balloon.offsetWidth / 2) - ( w.orientation%180 && OSVersion >= 6 ? 40 : 0 ) + 'px';
}
// Bootstrap!
init();
return {
show: manualShow,
close: close,
reset: reset
};
})(window);
-34
View File
@@ -1,34 +0,0 @@
String.prototype.format = function() { a = this; for ( k in arguments ) { a = a.replace("{" + k + "}", arguments[k]); } return a; };
window.gmAPI = {
'version': '3.0-rc1',
'ga': '',
'primaryUrl': 'http://code.google.com/p/jquery-ui-map/',
'url': 'http://jquery-ui-map.googlecode.com/',
'forum': 'http://groups.google.com/group/jquery-ui-map-discuss/feed/rss_v2_0_msgs.xml',
'subscribe': 'http://groups.google.com/group/jquery-ui-map-discuss/boxsubscribe',
'exception': 'Unable to load due to either poor internet connection or some CDN\'s aren\'t as responsive as we would like them to be. Try refreshing the page :D.',
'init': function() {
//window._gaq = [['_setAccount', this.ga], ['_trackPageview'], ['_trackPageLoadTime']];
//Modernizr.load({ 'test': ( location.href.indexOf(this.url) > -1 ), 'yep': 'http://www.google-analytics.com/ga.js' });
this.test('Backbone', function() {
$('#forum').append('<h2>Forum</h2><ul id="forum_posts"></ul><h2>Subscribe</h2><form id="forum_subscribe" class="subscribe" action="#"><label for="email">E-mail:</label><input id="email" type="text" name="email" /><input type="submit" name="sub" value="Subscribe" /></form>');
ForumCollection = Backbone.Collection.extend({ 'url': 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q={0}'.format(encodeURIComponent(gmAPI.forum)), 'parse': function(response) { return response.responseData.feed.entries; } });
ForumPost = Backbone.View.extend({ 'tagName': 'li', 'className': 'group-item', 'template': _.template('<a href="<%=link%>"><%=title%></a></h3>'), 'render': function() { $(this.el).html(this.template(this.model.toJSON())); return this; } });
Forum = Backbone.View.extend({ 'el': $("#forum"), 'initialize': function() { this.col = new ForumCollection(); this.col.bind('reset', this.load, this); this.col.fetch(); }, 'add': function(post) { var view = new ForumPost({'model': post}); $('#forum_posts').append(view.render().el); }, 'load': function () { this.col.each(this.add); $('#forum_subscribe').attr('action', gmAPI.subscribe); $(this.el).show(); } });
var app = new Forum();
});
this.test('prettyPrint', function() { prettyPrint(); });
$('#version').text(this.version);
},
'redirect': function(url) { alert('This page is deprecated. Please update your URL. Redirecting to new page.'); window.location = url; },
'col': [],
'tests': [],
'test': function(a, b) { if ( window[a] ) { b(); } },
'add': function(a, b) { if (b) { this.col[a] = b; } else { this.col.push(a); } return this; },
'load': function(a) { var self = this; if (a) { self.col[a](); } else { $.each(self.col, function(i,d) { try { d(); } catch (err) { alert(self.exception); } }); } },
'timeStart': function(key, desc) { this.tests[key] = { 'start': new Date().getTime(), 'desc': desc }; },
'timeEnd': function(key) { this.tests[key].elapsed = new Date().getTime(); },
'report': function(id) { var i = 1; for ( var k in this.tests ) { var t = this.tests[k]; $(id).append('<div class="benchmark rounded"><div class="benchmark-result lt">' + (t.elapsed - t.start) + ' ms</div><div class="lt"><p class="benchmark-iteration">Benchmark case ' + i + '</p><p class="benchmark-title">' + t.desc + '</p></div></div>'); i++; }; }
};
gmAPI.init();
@@ -1,2 +0,0 @@
/*! jQuery Mobile vGit Build: SHA1: b49cc06499abf8f987cf90f35349cfac0918c939 <> Date: Tue Oct 2 11:22:34 2012 -0700 jquerymobile.com | jquery.org/license !*/
(function(a,b,c){typeof define=="function"&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)})(this,document,function(a,b,c,d){(function(a,b,d){var e={};a.mobile=a.extend({},{version:"1.2.0",ns:"",subPageUrlKey:"ui-page",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:250,touchOverflowEnabled:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"e",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,orientationChangeEnabled:!0,buttonMarkup:{hoverDelay:200},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},silentScroll:function(d){a.type(d)!=="number"&&(d=a.mobile.defaultHomeScroll),a.event.special.scrollstart.enabled=!1,setTimeout(function(){b.scrollTo(0,d),a(c).trigger("silentscroll",{x:0,y:d})},20),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},nsNormalizeDict:e,nsNormalize:function(b){if(!b)return;return e[b]||(e[b]=a.camelCase(a.mobile.ns+b))},getInheritedTheme:function(a,b){var c=a[0],d="",e=/ui-(bar|body|overlay)-([a-z])\b/,f,g;while(c){f=c.className||"";if(f&&(g=e.exec(f))&&(d=g[2]))break;c=c.parentNode}return d||b||"a"},closestPageData:function(a){return a.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("page")},enhanceable:function(a){return this.haveParents(a,"enhance")},hijackable:function(a){return this.haveParents(a,"ajax")},haveParents:function(b,c){if(!a.mobile.ignoreContentEnabled)return b;var d=b.length,e=a(),f,g,h;for(var i=0;i<d;i++){g=b.eq(i),h=!1,f=b[i];while(f){var j=f.getAttribute?f.getAttribute("data-"+a.mobile.ns+c):"";if(j==="false"){h=!0;break}f=f.parentNode}h||(e=e.add(g))}return e},getScreenHeight:function(){return b.innerHeight||a(b).height()}},a.mobile),a.fn.jqmData=function(b,c){var e;return typeof b!="undefined"&&(b&&(b=a.mobile.nsNormalize(b)),arguments.length<2||c===d?e=this.data(b):e=this.data(b,c)),e},a.jqmData=function(b,c,d){var e;return typeof c!="undefined"&&(e=a.data(b,c?a.mobile.nsNormalize(c):c,d)),e},a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))},a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))},a.fn.removeWithDependents=function(){a.removeWithDependents(this)},a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove(),c.remove()},a.fn.addDependents=function(b){a.addDependents(a(this),b)},a.addDependents=function(b,c){var d=a(b).jqmData("dependents")||a();a(b).jqmData("dependents",a.merge(d,c))},a.fn.getEncodedText=function(){return a("<div/>").text(a(this).text()).html()},a.fn.jqmEnhanceable=function(){return a.mobile.enhanceable(this)},a.fn.jqmHijackable=function(){return a.mobile.hijackable(this)};var f=a.find,g=/:jqmData\(([^)]*)\)/g;a.find=function(b,c,d,e){return b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]"),f.call(this,b,c,d,e)},a.extend(a.find,f),a.find.matches=function(b,c){return a.find(b,null,null,c)},a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0}})(a,this),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c=0,d;(d=b[c])!=null;c++)try{a(d).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i=b.split(".")[0];b=b.split(".")[1],e=i+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e]=function(b){return!!a.data(b,e)},a[i]=a[i]||{},f=a[i][b],g=a[i][b]=function(a,b){if(!this._createWidget)return new g(a,b);arguments.length&&this._createWidget(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,e){a.isFunction(e)&&(d[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},d=function(a){return c.prototype[b].apply(this,a)};return function(){var b=this._super,c=this._superApply,f;return this._super=a,this._superApply=d,f=e.apply(this,arguments),this._super=b,this._superApply=c,f}}())}),g.prototype=a.widget.extend(h,{widgetEventPrefix:b},d,{constructor:g,namespace:i,widgetName:b,widgetBaseClass:e,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g)},a.widget.extend=function(c){var e=d.call(arguments,1),f=0,g=e.length,h,i;for(;f<g;f++)for(h in e[f])i=e[f][h],e[f].hasOwnProperty(h)&&i!==b&&(c[h]=a.isPlainObject(i)?a.widget.extend({},c[h],i):i);return c},a.widget.bridge=fuLine truncated
@@ -1,147 +0,0 @@
(function( $ ) {
$.fn.muImageResize = function( params ) {
var _defaultSettings = {
width:300,
height:300,
wrap_fix:true // Let image display like in-line.
};
var _set = $.extend(_defaultSettings, params);
var isIE7 = $.browser.msie && (7 == ~~ $.browser.version);
//var anyDynamicSource = $(this).attr("src");
//$(this).attr("src",anyDynamicSource+ "?" + new Date().getTime());
// Just bind load event once per element.
return this.one('load', function() {
// Remove all attributes and CSS rules.
this.removeAttribute( "width" );
this.removeAttribute( "height" );
this.style.width = this.style.height = "";
var ow, oh;
//[workaround] - msie need get width early
if ($.browser.msie)
{
// Get original size for calcutation.
ow = this.width;
oh = this.height;
}
if (_set.wrap_fix) {
$(this).wrap(function(){
return '<div style="width:'+_set.width+'px; height:'+_set.height+'px; display:inline-block;" />';
});
}
if (!$.browser.msie)
{
// Get original size for calcutation.
ow = this.width;
oh = this.height;
}
// if cannot get width or height.
if (0==ow || 0==oh){
$(this).width(_set.width);
$(this).height(_set.height);
}else{
// Merge position settings
var sh_margin_type='';
// if original image's width > height.
if (ow > oh) {
p = oh / _set.height;
oh = _set.height;
ow = ow / p;
// original image width smaller than settings.
if (ow < _set.width){
// need to resize again,
// because new image size range must can cover settings' range, than we can crop it correctly.
p = ow / _set.width;
ow = _set.width;
oh = oh / p;
// the crop range would be in the center of new image size.
sh = (oh-_set.height)/2;
t=sh+'px';
r=_set.width+'px';
b=(_set.height+sh)+'px';
l='0px';
// need to be adjust top position latter.
sh_margin_type = 'margin-top';
// original image width bigger than settings.
}else{
// new image range can cover settings' range.
sh = (ow-_set.width)/2;
t='0px';
r=(_set.width+sh)+'px';
b=_set.height+'px';
l=sh+'px';
// need to be adjust left position latter.
sh_margin_type = 'margin-left';
}
// ref above, change width to height then do same things.
}else{
p = ow / _set.width;
ow = _set.width;
oh = oh / p;
if (oh < _set.height) {
p = oh / _set.height;
oh = _set.height;
ow = ow / p;
sh = (ow-_set.width)/2;
t='0px';
r=(_set.width+sh)+'px';
b=_set.height+'px';
l=sh+'px';
sh_margin_type = 'margin-left';
}else{
sh = (oh-_set.height)/2;
t=sh+'px';
r=_set.width+'px';
b=(_set.height+sh)+'px';
l='0px';
sh_margin_type = 'margin-top';
}
}
// Resize img.
$(this).width(ow);
$(this).height(oh);
// Crop img by set clip style.
$(this).css('clip','rect('+t+' '+r+' '+b+' '+l+')');
var osh = 0;
if('auto' != $(this).css(sh_margin_type)){
osh = parseInt($(this).css(sh_margin_type));
}
if (0 < sh) {sh*=-1;}
sh += osh;
$(this).css(sh_margin_type, sh+'px');
$(this).css('position','absolute');
}
$(this).fadeIn('slow');
})
.one( "error", function() {
//$(this).hide();
})
.each(function() {
$(this).hide();
// Trigger load event (for Gecko and MSIE)
if ( this.complete || $.browser.msie ) {
$( this ).trigger( "load" ).trigger( "error" );
}
});
};
})( jQuery );
@@ -1,242 +0,0 @@
//SwipePlanes v1.2 jQuery Plugin by REMD
$.fn.swipePlanes = function(opciones){
return this.each(function(){
var randId = Math.round(100*Math.random()); ////IDENTIFICADOR ALEATORIO DE LA INSTANCIA//////////
//EL VISOR /////////////////////////////////////
this.onselectstart = function(){return false;};
this.unselectable = "on";
$(this).css('-moz-user-select', 'none');
$(this).css('-webkit-user-select', 'none');
$(this).css('overflow','hidden');
if($(this).css('position') != 'absolute')$(this).css('position','relative');
var anchoVisor = $(this).width();
var altoVisor = $(this).height;
var divVisor = this;
//El CONTENEDOR /////////////////////////////////////
var divContenedor;
var pagActual = 0;
divContenedor = $(this).children('div:first');
divContenedor.css('transition','none');
divContenedor.css('-moz-user-select', 'none');
divContenedor.css('-webkit-user-select', 'none');
divContenedor.css('position','relative');
divContenedor.css('left','0px');
//LAS PAGINAS /////////////////////////////////////////
var divPaginas;
var bufferPaginas = 0;
var metaPaginas = 0;
var metaPagNum = 0;
divPaginas = divContenedor.children('div,a');
divPaginas.css('display','inline-block');
divPaginas.css('float','left');
divPaginas.css('position','relative');
metaPaginas = new Array();
metaPaginas[0] = 0;
divPaginas.each(function(){
if((bufferPaginas+(this.offsetWidth)) > anchoVisor+metaPaginas[metaPagNum]){
if(bufferPaginas > 0)metaPagNum++;
metaPaginas[metaPagNum] = bufferPaginas;
}
bufferPaginas += (this.offsetWidth + parseInt($(this).css('margin-left'))+parseInt($(this).css('margin-right')));
});
metaPaginas[metaPagNum] -= anchoVisor - (bufferPaginas-metaPaginas[metaPagNum]); //Ajuste �ltimo salto
divContenedor.css('width',bufferPaginas+'px'); //Ajuste Contenedor al tamano de las paginas
generarControles($(this),metaPagNum);
//LOS EVENTOS ////////////////////////////////////////////
var iX = 0,aX = 0,fX = 0; //Manejo de coordenadas
var drag = 0,t = 0,ms = 0,metaEvento,dX = 0; //Manejo del entorno/tiempo
$(this).bind('touchstart',function(event){
clearInterval(t);
if(event.pageX)iX = event.pageX;
if(event.originalEvent.touches)iX = event.originalEvent.touches[0].pageX;
divContenedor.css('transition','none');
drag = 1;
ms = 0;
metaEvento = 'click';
t = setInterval(function(){ms++;},1);
});
$(this).bind('touchmove',function(event){
if(event.pageX)aX = event.pageX;
if(event.originalEvent.touches)aX = event.originalEvent.touches[0].pageX;
dX = Math.abs(aX - iX);
if(dX > 50)event.preventDefault();
if(drag && dX > 50){
divContenedor.css('left',(((metaPaginas[pagActual]*-1)+(aX - iX)))+'px');
}
});
$(this).bind('touchend touchcancel touchleave',function(event){
if(drag && dX > 20){
drag = 0;
console.log(metaPaginas);
dX = Math.abs(fX - iX);
clearInterval(t);
if(event.pageX)fX = event.pageX;
if(event.originalEvent.touches)fX = aX;
if((iX-fX) > 0 && ms < 100 && dX > 50)metaEvento = 'swipeLeft';
if((iX-fX) <= 0 && ms < 100 && dX > 50)metaEvento = 'swipeRight';
if((iX-fX) > 0 && ms > 100 && dX > 50)metaEvento = 'moveLeft';
if((iX-fX) <= 0 && ms > 100 && dX > 50)metaEvento = 'moveRight';
if(dX <= 50)metaEvento = 'click';
switch(metaEvento){
case 'swipeLeft':
if(pagActual < metaPagNum){pagActual++;}
break;
case 'moveLeft':
if(pagActual < metaPagNum && dX > (Math.abs(anchoVisor/2))){pagActual++;}
break;
case 'swipeRight':
if(pagActual > 0){pagActual--;}
break;
case 'moveRight':
if(pagActual > 0 && dX > (Math.abs(anchoVisor/2))){pagActual--;}
break;
}
ms = 0; dX = 0; iX = 0; aX = 0; fX = 0; metaEvento = '';
irPagina(pagActual);
}
});
//EVENTOS CONTROLES /////////////////////////////////////////
$('.'+randId+'swipePlanesMiniPag').click(function(){
pagActual = $(this).attr('mpg');
irPagina();
});
$('.'+randId+'swipePlanesRowLeft').click(function(e){
e.stopPropagation();
e.preventDefault();
if(pagActual > 0)pagActual--;
irPagina();
});
$('.'+randId+'swipePlanesRowRight').click(function(e){
e.preventDefault();
e.stopPropagation();
if(pagActual < metaPagNum)pagActual++;
irPagina();
});
$(this).bind('mousemove',function(){
$('.'+randId+'swipePlanesRowLeft').css('display','block');
$('.'+randId+'swipePlanesRowRight').css('display','block');
$('.'+randId+'swipePlanesRowLeft').css('opacity','1');
$('.'+randId+'swipePlanesRowRight').css('opacity','1');
});
$('.'+randId+'swipePlanesRowLeft').bind('mousemove',function(){
$('.'+randId+'swipePlanesRowLeft').css('opacity','1');
$('.'+randId+'swipePlanesRowRight').css('opacity','1');
});
$('.'+randId+'swipePlanesRowRight').bind('mousemove',function(){
$('.'+randId+'swipePlanesRowLeft').css('opacity','1');
$('.'+randId+'swipePlanesRowRight').css('opacity','1');
});
$(this).mouseout(function(){
$('.'+randId+'swipePlanesRowLeft').css('opacity','0');
$('.'+randId+'swipePlanesRowRight').css('opacity','0');
});
//CONTROLES //////////////////////////////////////////////
function generarControles(divVisor,metaPagNum){
var i = 0;
var miniPaginasHtml = '';
var style = '';
for(i;i <= metaPagNum; i++){
if(!i)style='background:#CECECE';
else style='';
miniPaginasHtml += '<div mpg="'+i+'" style="'+style+'" class="'+randId+'swipePlanesMiniPag"></div>';
}
// <div class="'+randId+'swipePlanesRowLeft"></div><div class="'+randId+'swipePlanesRowRight"></div>
var controlesHtml = '<div class="'+randId+'swipePlanesPaginator">'+miniPaginasHtml+'</div>';
divVisor.append(controlesHtml);
$('.'+randId+'swipePlanesMiniPag').css('display','inline-block');
$('.'+randId+'swipePlanesMiniPag').css('width','7px');
$('.'+randId+'swipePlanesMiniPag').css('height','7px');
$('.'+randId+'swipePlanesMiniPag').css('margin-left','2px');
$('.'+randId+'swipePlanesMiniPag').css('margin-right','2px');
$('.'+randId+'swipePlanesMiniPag').css('border','1px solid #CECECE');
$('.'+randId+'swipePlanesMiniPag').css('border-radius','4px');
$('.'+randId+'swipePlanesMiniPag').css('cursor','pointer');
$('.'+randId+'swipePlanesRowLeft').css('background-image','url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABkCAYAAADE6GNbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAKwwAACsMBNCkkqwAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMTAvMTkvMTJlCtGpAAABaElEQVR4nO3cS3HEMBRE0atU1oaURTCIwxiSh4NQBNIQcDDEfp/OVF8AKp3yR5IXHsD3GIP/3HmefI4xOI6jey632vedj+5JRGWIWoaoZYhahqhliFqGqGWIWoaoZYhahqhliFqGqGWIWoZENed8RIzTCplzPrZt+4oYqw0SiYAmSDQCGiAZCCiGZCGgEJKJgCJINgIKIBUISIZUISARUomAJEg1AhIgHQgIhnQhIBDSiYAgSDcCAiAKCLgJUUHADYgSAi5C1BBwAaKIAIGPD1H9GbLWer5er5+Mydzp0hVRxFy+tdQwt54RJczth10FE/LWUsCEvX67MaHrSCcmfEHswqSs7B2YtC1KNSZ1r1WJSd80VmFKdr8VmLJtfDam9DySiSk/WGVhWk6IGZi2o240pvXMHolp//iw1npGjNMOicoQtQxRyxC1DFHLELUMUcsQtQxRyxC1DFHLELUMUettIIM3+XXbL64qrlAHZEgkAAAAAElFTkSuQmCC)');
$('.'+randId+'swipePlanesRowLeft').css('position','absolute');
$('.'+randId+'swipePlanesRowLeft').css('width','50px');
$('.'+randId+'swipePlanesRowLeft').css('height','100px');
$('.'+randId+'swipePlanesRowLeft').css('cursor','pointer');
$('.'+randId+'swipePlanesRowLeft').css('left','0px');
$('.'+randId+'swipePlanesRowLeft').css('top',((divVisor.height()/2)-50)+'px');
$('.'+randId+'swipePlanesRowLeft').css('z-index','909');
$('.'+randId+'swipePlanesRowLeft').css('display','none');
$('.'+randId+'swipePlanesRowLeft').css('box-shadow','0 1px 3px rgba(0, 0, 0, 0.3);');
$('.'+randId+'swipePlanesRowRight').css('background-image','url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABkCAYAAADE6GNbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAKwwAACsMBNCkkqwAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMTAvMTkvMTJlCtGpAAABXklEQVR4nO3cvW2EQBRF4TPWxpTkwDXQw1IS7oEqXBINsKlTM+/nenVPDuKTYOZNwgC+xhj8567r4jHGYN/37meZats2ProfIipD1DJELUPUMkQtQ9QyRC1D1DJELUPUMkQtQ9QyRC1D1DLkd+u6PiPuM1MIZFmWz25M2KvVjQn9Rjox4R97FyZl1erApC2/1ZjUfaQSk74hVmFKdvYKTNmIko0pnbUyMeVDYxamZfrNwLSN8dGY1vNIJKb9YBWFaYdADEYCAvMYGQjMYaQgcB8jB7mbHOQ8z5/jOL7/ep0U5C4ChCAzCBCBzCJAABKBgGZIFAIaIZEIaIJEI6ABkoGAYkgWAgohmQgogmQjoABSgYBkSBUCEiGVCEiCVCMgAdKBgGBIFwICIZ0ICIJ0IyAI0o0AgYNVVIaoZYhahqhliFqGqGWIWoaoZYhahqhliFqGqGWIWm8DGbzJr9teHYWuULzgkDAAAAAASUVORK5CYII=)');
$('.'+randId+'swipePlanesRowRight').css('position','absolute');
$('.'+randId+'swipePlanesRowRight').css('width','50px');
$('.'+randId+'swipePlanesRowRight').css('height','100px');
$('.'+randId+'swipePlanesRowRight').css('cursor','pointer');
$('.'+randId+'swipePlanesRowRight').css('right','0px');
$('.'+randId+'swipePlanesRowRight').css('top',((divVisor.height()/2)-50)+'px');
$('.'+randId+'swipePlanesRowRight').css('z-index','909');
$('.'+randId+'swipePlanesRowRight').css('display','none');
$('.'+randId+'swipePlanesRowRight').css('box-shadow','0 1px 3px rgba(0, 0, 0, 0.3);');
$('.'+randId+'swipePlanesPaginator').css('position','absolute');
$('.'+randId+'swipePlanesPaginator').css('padding','0px 4px');
$('.'+randId+'swipePlanesPaginator').css('top','10px');
$('.'+randId+'swipePlanesPaginator').css('box-shadow','0 1px 3px rgba(0, 0, 0, 0.3);');
$('.'+randId+'swipePlanesPaginator').css('border-radius','4px');
$('.'+randId+'swipePlanesPaginator').css('left',((divVisor.width()/2)-($('.'+randId+'swipePlanesPaginator').width()/2))+'px');
}
function irPagina(){
divContenedor.css('transition','left 500ms');
divContenedor.css('left',((metaPaginas[pagActual])*-1)+'px');
$('.'+randId+'swipePlanesMiniPag').css('background','');
$('.'+randId+'swipePlanesMiniPag[mpg='+pagActual+']').css('background','#CECECE');
}
});
};
-373
View File
@@ -1,373 +0,0 @@
/*!
* jQuery FN Google Map 3.0-rc
* http://code.google.com/p/jquery-ui-map/
* Copyright (c) 2010 - 2012 Johan Säll Larsson
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
( function($) {
/**
* @param name:string
* @param prototype:object
*/
$.a = function(name, prototype) {
var namespace = name.split('.')[0];
name = name.split('.')[1];
$[namespace] = $[namespace] || {};
$[namespace][name] = function(options, element) {
if ( arguments.length ) {
this._setup(options, element);
}
};
$[namespace][name].prototype = $.extend({
'namespace': namespace,
'pluginName': name
}, prototype);
$.fn[name] = function(options) {
var isMethodCall = typeof options === "string",
args = Array.prototype.slice.call(arguments, 1),
returnValue = this;
if ( isMethodCall && options.substring(0, 1) === '_' ) {
return returnValue;
}
this.each(function() {
var instance = $.data(this, name);
if (!instance) {
instance = $.data(this, name, new $[namespace][name](options, this));
}
if (isMethodCall) {
returnValue = instance[options].apply(instance, args);
}
});
return returnValue;
};
};
$.a('ui.gmap', {
/**
* Map options
* @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MapOptions
*/
options: {
mapTypeId: 'roadmap',
zoom: 5
},
/**
* Get or set options
* @param key:string
* @param options:object
* @return object
*/
option: function(key, options) {
if (options) {
this.options[key] = options;
this.get('map').set(key, options);
return this;
}
return this.options[key];
},
/**
* Setup plugin basics,
* @param options:object
* @param element:node
*/
_setup: function(options, element) {
this.el = element;
options = options || {};
jQuery.extend(this.options, options, { 'center': this._latLng(options.center) });
this._create();
if ( this._init ) { this._init(); }
},
/**
* Instanciate the Google Maps object
*/
_create: function() {
var self = this;
this.instance = { 'map': new google.maps.Map(self.el, self.options), 'markers': [], 'overlays': [], 'services': [] };
google.maps.event.addListenerOnce(self.instance.map, 'bounds_changed', function() { $(self.el).trigger('init', self.instance.map); });
self._call(self.options.callback, self.instance.map);
},
/**
* Adds a latitude longitude pair to the bounds.
* @param position:google.maps.LatLng/string
*/
addBounds: function(position) {
var bounds = this.get('bounds', new google.maps.LatLngBounds());
bounds.extend(this._latLng(position));
this.get('map').fitBounds(bounds);
return this;
},
/**
* Helper function to check if a LatLng is within the viewport
* @param marker:google.maps.Marker
*/
inViewport: function(marker) {
var bounds = this.get('map').getBounds();
return (bounds) ? bounds.contains(marker.getPosition()) : false;
},
/**
* Adds a custom control to the map
* @param panel:jquery/node/string
* @param position:google.maps.ControlPosition
* @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#ControlPosition
*/
addControl: function(panel, position) {
this.get('map').controls[position].push(this._unwrap(panel));
return this;
},
/**
* Adds a Marker to the map
* @param markerOptions:google.maps.MarkerOptions
* @param callback:function(map:google.maps.Map, marker:google.maps.Marker) (optional)
* @return $(google.maps.Marker)
* @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#MarkerOptions
*/
addMarker: function(markerOptions, callback) {
markerOptions.map = this.get('map');
markerOptions.position = this._latLng(markerOptions.position);
var marker = new (markerOptions.marker || google.maps.Marker)(markerOptions);
var markers = this.get('markers');
if ( marker.id ) {
markers[marker.id] = marker;
} else {
markers.push(marker);
}
if ( marker.bounds ) {
this.addBounds(marker.getPosition());
}
this._call(callback, markerOptions.map, marker);
return $(marker);
},
/**
* Clears by type
* @param ctx:string e.g. 'markers', 'overlays', 'services'
*/
clear: function(ctx) {
this._c(this.get(ctx));
this.set(ctx, []);
return this;
},
_c: function(obj) {
for ( var property in obj ) {
if ( obj.hasOwnProperty(property) ) {
if ( obj[property] instanceof google.maps.MVCObject ) {
google.maps.event.clearInstanceListeners(obj[property]);
if ( obj[property].setMap ) {
obj[property].setMap(null);
}
} else if ( obj[property] instanceof Array ) {
this._c(obj[property]);
}
obj[property] = null;
}
}
},
/**
* Returns the objects with a specific property and value, e.g. 'category', 'tags'
* @param ctx:string in what context, e.g. 'markers'
* @param options:object property:string the property to search within, value:string, operator:string (optional) (AND/OR)
* @param callback:function(marker:google.maps.Marker, isFound:boolean)
*/
find: function(ctx, options, callback) {
var obj = this.get(ctx);
options.value = $.isArray(options.value) ? options.value : [options.value];
for ( var property in obj ) {
if ( obj.hasOwnProperty(property) ) {
var isFound = false;
for ( var value in options.value ) {
if ( $.inArray(options.value[value], obj[property][options.property]) > -1 ) {
isFound = true;
} else {
if ( options.operator && options.operator === 'AND' ) {
isFound = false;
break;
}
}
}
callback(obj[property], isFound);
}
}
return this;
},
/**
* Returns an instance property by key. Has the ability to set an object if the property does not exist
* @param key:string
* @param value:object(optional)
*/
get: function(key, value) {
var instance = this.instance;
if ( !instance[key] ) {
if ( key.indexOf('>') > -1 ) {
var e = key.replace(/ /g, '').split('>');
for ( var i = 0; i < e.length; i++ ) {
if ( !instance[e[i]] ) {
if (value) {
instance[e[i]] = ( (i + 1) < e.length ) ? [] : value;
} else {
return null;
}
}
instance = instance[e[i]];
}
return instance;
} else if ( value && !instance[key] ) {
this.set(key, value);
}
}
return instance[key];
},
/**
* Triggers an InfoWindow to open
* @param infoWindowOptions:google.maps.InfoWindowOptions
* @param marker:google.maps.Marker (optional)
* @param callback:function (optional)
* @see http://code.google.com/intl/sv-SE/apis/maps/documentation/javascript/reference.html#InfoWindowOptions
*/
openInfoWindow: function(infoWindowOptions, marker, callback) {
var iw = this.get('iw', infoWindowOptions.infoWindow || new google.maps.InfoWindow);
iw.setOptions(infoWindowOptions);
iw.open(this.get('map'), this._unwrap(marker));
this._call(callback, iw);
return this;
},
/**
* Triggers an InfoWindow to close
*/
closeInfoWindow: function() {
if ( this.get('iw') != null ) {
this.get('iw').close();
}
return this;
},
/**
* Sets an instance property
* @param key:string
* @param value:object
*/
set: function(key, value) {
this.instance[key] = value;
return this;
},
/**
* Refreshes the map
*/
refresh: function() {
var map = this.get('map');
var latLng = map.getCenter();
$(map).triggerEvent('resize');
map.setCenter(latLng);
return this;
},
/**
* Destroys the plugin.
*/
destroy: function() {
this.clear('markers').clear('services').clear('overlays')._c(this.instance);
jQuery.removeData(this.el, this.name);
},
/**
* Helper method for calling a function
* @param callback
*/
_call: function(callback) {
if ( callback && $.isFunction(callback) ) {
callback.apply(this, Array.prototype.slice.call(arguments, 1));
}
},
/**
* Helper method for google.maps.Latlng
* @param latLng:string/google.maps.LatLng
*/
_latLng: function(latLng) {
if ( !latLng ) {
return new google.maps.LatLng(0.0, 0.0);
}
if ( latLng instanceof google.maps.LatLng ) {
return latLng;
} else {
latLng = latLng.replace(/ /g,'').split(',');
return new google.maps.LatLng(latLng[0], latLng[1]);
}
},
/**
* Helper method for unwrapping jQuery/DOM/string elements
* @param obj:string/node/jQuery
*/
_unwrap: function(obj) {
return (!obj) ? null : ( (obj instanceof jQuery) ? obj[0] : ((obj instanceof Object) ? obj : $('#'+obj)[0]) )
}
});
jQuery.fn.extend( {
triggerEvent: function(eventType) {
google.maps.event.trigger(this[0], eventType);
return this;
},
addEventListener: function(eventType, eventDataOrCallback, eventCallback) {
if ( google.maps && this[0] instanceof google.maps.MVCObject ) {
google.maps.event.addListener(this[0], eventType, eventDataOrCallback);
} else {
if (eventCallback) {
this.bind(eventType, eventDataOrCallback, eventCallback);
} else {
this.bind(eventType, eventDataOrCallback);
}
}
return this;
}
/*removeEventListener: function(eventType) {
if ( google.maps && this[0] instanceof google.maps.MVCObject ) {
if (eventType) {
google.maps.event.clearListeners(this[0], eventType);
} else {
google.maps.event.clearInstanceListeners(this[0]);
}
} else {
this.unbind(eventType);
}
return this;
}*/
});
jQuery.each(('click rightclick dblclick mouseover mouseout drag dragend').split(' '), function(i, name) {
jQuery.fn[name] = function(a, b) {
return this.addEventListener(name, a, b);
}
});
} (jQuery) );
@@ -1,130 +0,0 @@
<%#= encoding: utf-8 %>
// function slideshow() {
// var $globalW = $(".global").width(),
// $slideImg = $(".slideImg"),
// $slidebanner = $(".slidebanner"),
// $slideshow = $(".slideshow"),
// $slideImgOW = $slideImg.width(),
// $slideImgOH = $slideImg.height();
// $slideImg.css({
// "widht": $globalW,
// "height": Math.floor(($globalW/$slideImgOW)*$slideImgOH),
// });
// $slideshow.css({
// "width": $globalW,
// "height": Math.floor(($globalW/$slideImgOW)*$slideImgOH),
// });
// alert(Math.floor(($globalW/$slideImgOW)*$slideImgOH))
// }
$('#index').live('pageinit',function(){
var $globalW = $(window).width(),
$slideshow = $(".slideshow");
$slideshow.css({
"width": $globalW, "height": Math.floor($globalW/720*240)
});
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
$(this).find(".newpic img").muImageResize({width: 280, height: 200});
$('.slideshow').cycle({
fx: $effect,
timeout: $timeout
});
$(".newlist").css({
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
})
// var oc_timer;
// clearTimeout(oc_timer);
// oc_timer = setTimeout(function () {
// $('.newlist').swipePlanes();
// }, 1000);
});
$('#announcement_content').live('pageinit',function(){
$(this).find(".newpic img").muImageResize({width: 320, height: 220});
});
$('#map').live('pageinit', function() {
var mobileDemo = { 'center': $map_center, 'zoom': $map_zoom };
var $windowH = $(window).height();
$("#map_canvas").css({
'height' : $windowH,
})
gmAPI.add('basic_map', function() {
$('#map_canvas').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':false, 'callback': function() {
var self = this;
self.addMarker({'position': this.get('map').getCenter() }).click(function() {
self.openInfoWindow({ 'content': $info }, this);
});
}});
}).load('basic_map');
});
$('#map').live('pageshow', function() {
gmAPI.add('basic_map', function() { $('#map_canvas').gmap('refresh'); }).load('basic_map');
});
$(document).bind('pagebeforehide',function(){
$("section.main-menu").removeClass("expanded");
});
$(document).bind("ready", function(){
// $(".openmenu").live("tap", function(){
// $("section.main-menu").toggleClass("expanded");
// return!1
// });
$("body").delegate(".openmenu","vclick",function(){
$("section.main-menu").toggleClass("expanded");
return!1
});
// alert(navigator.userAgent)
// $(".newpic img").muImageResize({width: 280, height: 100});
// $('.newlist').swipePlanes();
});
// $(window).resize(function(){
// alert("Resize");
// $(".slidebanner").removeAttr("style");
// $(".slidebanner").find("div").removeAttr("style");
// $(".slideImg").removeAttr("style");
// var $globalW = $(window).width(),
// $slideshow = $(".slideshow");
// $slideshow.css({
// "width": $globalW, "height": Math.floor($globalW/720*240)
// });
// $(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
// $('.slideshow').cycle({
// fx:'scrollLeft',
// timeout: 6000,
// });
// });
$(window).bind("orientationchange", function(){
var oc_timer;
clearTimeout(oc_timer);
oc_timer = setTimeout(function () {
$(".slidebanner").removeAttr("style");
$(".slidebanner").find("div").removeAttr("style");
$(".slideImg").removeAttr("style");
// $(".newlist").removeAttr("style");
// $(".newlist").find(".clear").removeAttr("style");
// $(".newitem").removeAttr("style");
// $(".newlist").find(".clear").nextAll("div").remove();
var $globalW = $(window).width(),
$slideshow = $(".slideshow"),
$windowH = $(window).height();
$slideshow.css({
"width": $globalW, "height": Math.floor($globalW/720*240)
});
$(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)});
$('.slideshow').cycle({
fx: $effect,
timeout: $timeout
});
$(".newlist").css({
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
})
$("#map_canvas").css({
'height' : $windowH,
})
// $('.newlist').swipePlanes();
}, 500);
});
+2 -2
View File
@@ -3,5 +3,5 @@
//= require basic/bootstrap
//= require kernel
//= require lib/jquery.preload.min.js
//= require cycle2
//= require lib/jquery.preload-min.js
//= require lib/jquery.cycle.all.latest.js
+5 -5
View File
@@ -1,17 +1,17 @@
.banner_nav {
#banner_nav {
position: absolute;
z-index: 10;
bottom: 0;
margin-right: 5px;
right: 0;
}
.banner_nav>li {
#banner_nav>li {
float: left;
display: inline-block;
*display: inline;
}
.banner_nav>li>a {
#banner_nav>li>a {
display:block;
width: 10px;
height: 10px;
@@ -25,11 +25,11 @@
text-indent: -9999px;
box-shadow: 0 0 5px rgba(0,0,0,.7);
}
.banner_nav>li>a:hover {
#banner_nav>li>a:hover {
opacity: 1;
filter: alpha(opacity = 100);
}
.banner_nav>li.activeSlide>a {
#banner_nav>li.activeSlide>a {
opacity: 1;
filter: alpha(opacity = 100);
}
+26 -52
View File
@@ -8,7 +8,7 @@
overflow: auto;
/* Specify the width of your pageslide here */
/*padding: 5px;*/
padding: 5px;
/* These styles are optional, and describe how the pageslide will look */
background-color: #333;
@@ -17,29 +17,34 @@
-moz-box-shadow: inset 0 0 5px 5px #222;
box-shadow: inset 0 0 5px 5px #222;
}
#pageslide .page-title {
padding: 10px;
background-color: #232323;
border-bottom: 1px solid #424242;
line-height: 2em;
}
#pageslide .page-title a {
color: #FFF;
text-decoration: none;
font-size: 1.6em;
}
#pageslide .page-title span {
font-size: 1.7em;
}
#pageslide .view-page {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
#pageslide .content {
padding: 15px;
}
#pageslide #view-page .content,
#pageslide #view-page .pane {
outline: none;
padding: 0px;
margin-top: 57px;
}
#pageslide #view-page .content {
padding-bottom: 10px;
}
#pageslide #view-page .page-info {
padding: 0 10px;
border-bottom: 1px solid #222222;
box-shadow: 0px 1px 0px #404040;
line-height: 50px;
}
#pageslide #view-page .page-info a {
color: #8f8f8f;
font-size: 2em;
text-decoration: none;
}
#pageslide #view-page .page-info a:hover {
color: #efefef;
}
#pageslide #view-page .page-info h3 {
margin: 5px 0;
}
#pageslide form {
margin-bottom: 0;
@@ -84,35 +89,4 @@
display: inline-block;
height: 30px;
padding: 0 2px 0 5px;
}
#pageslide .groups {
margin-bottom: 10px;
}
#pageslide .error-cover {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
text-align: center;
background-color: #333;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
opacity: .95;
}
#pageslide .error-cover .msg {
position: absolute;
top: 50%;
margin-top: -55px;
height: 110px;
width: 100%;
}
#pageslide .error-cover i {
font-size: 6em;
}
#pageslide .error-cover p {
font-size: 1.3em;
}
#pageslide .suckIE {
color: #EE4545;
}
-10
View File
@@ -1,10 +0,0 @@
/*
*This is a manifest file that'll automatically include all the stylesheets available in this directory
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require mobile/jquery.mobile-1.2.0.css
*= require mobile/add2home
*= require mobile/orbit-mobile
*= require basic/icon
*= require basic/font-awesome
*/
-158
View File
@@ -1,158 +0,0 @@
/**
*
* Main container
*
*/
#addToHomeScreen {
z-index:9999;
-webkit-user-select:none;
-webkit-box-sizing:border-box;
width:240px;
font-size:15px;
padding:12px 14px;
text-align:left;
font-family:helvetica;
background-image:-webkit-gradient(linear,0 0,0 100%,color-stop(0,#fff),color-stop(0.02,#eee),color-stop(0.98,#ccc),color-stop(1,#a3a3a3));
border:1px solid #505050;
-webkit-border-radius:8px;
-webkit-background-clip:padding-box;
color:#333;
text-shadow:0 1px 0 rgba(255,255,255,0.75);
line-height:130%;
-webkit-box-shadow:0 0 4px rgba(0,0,0,0.5);
}
#addToHomeScreen.addToHomeIpad {
width:268px;
font-size:18px;
padding:14px;
}
/**
*
* The 'wide' class is added when the popup contains the touch icon
*
*/
#addToHomeScreen.addToHomeWide {
width:296px;
}
#addToHomeScreen.addToHomeIpad.addToHomeWide {
width:320px;
font-size:18px;
padding:14px;
}
/**
*
* The balloon arrow
*
*/
#addToHomeScreen .addToHomeArrow {
position:absolute;
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#ccc));
border-width:0 1px 1px 0;
border-style:solid;
border-color:#505050;
width:16px; height:16px;
-webkit-transform:rotateZ(45deg);
bottom:-9px; left:50%;
margin-left:-8px;
-webkit-box-shadow:inset -1px -1px 0 #a9a9a9;
-webkit-border-bottom-right-radius:2px;
}
/**
*
* The balloon arrow for iPad
*
*/
#addToHomeScreen.addToHomeIpad .addToHomeArrow {
-webkit-transform:rotateZ(-135deg);
background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(238,238,238,0)),color-stop(0.4,rgba(238,238,238,0)),color-stop(0.4,#eee));
-webkit-box-shadow:inset -1px -1px 0 #fff;
top:-9px; bottom:auto; left:50%;
}
/**
*
* Close button
*
*/
#addToHomeScreen .addToHomeClose {
-webkit-box-sizing:border-box;
position:absolute;
right:4px;
top:4px;
width:18px;
height:18px; line-height:14px;
text-align:center;
text-indent:1px;
-webkit-border-radius:9px;
background:rgba(0,0,0,0.12);
color:#707070;
-webkit-box-shadow:0 1px 0 #fff;
font-size:16px;
}
/**
*
* The '+' icon, displayed only on iOS < 4.2
*
*/
#addToHomeScreen .addToHomePlus {
font-weight:bold;
font-size:1.3em;
}
/**
*
* The 'share' icon, displayed only on iOS >= 4.2
*
*/
#addToHomeScreen .addToHomeShare {
display:inline-block;
width:18px;
height:15px;
background-repeat:no-repeat;
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAQAAABDj1eZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUdJREFUKFNtkLtLw1AYxS/qJLhXVKr2ZRulUNtiqgSb3CziICI6ucTFVYcOnaQOFRwUnNTRwUWXgpP/QdHNUEQUHGxofYBTlRs83iZNjKTncOGe7/vx3QchXUWn6FL3jhfKUdCCr5zuifV5oDiHQM+c+CIhiiCSWNu08iq9oHXKLAiqrgR4UXqlOEYZt++ExEL0wW7+OW0G10muLv9gmqfe5FAWKmTMYQYiFL7PYwyLOD8lSjNh2gdnPzMII4QUBxc4OothbAF7GCBKQ0YbSWyPQsIhqvetS+y0ygGMo/KFZfviDvR4AhwgZU9dGYnA0J/6ndc15i3ouYIMcVVUcEXIoOxCeRCfwP8sXBSdjtpUv/1QW+K16kCCIUC4id9Fa0JtkluwVkSfqPL6RwfSDA0aNlx7k/bWgViB7bMS2/1vk5sdsZLN/ALSuL3tylO4RAAAAABJRU5ErkJggg==);
background-size:18px 15px;
text-indent:-9999em;
overflow:hidden;
}
/**
*
* The touch icon (if available)
*
*/
#addToHomeScreen .addToHomeTouchIcon {
display:block;
float:left;
-webkit-border-radius:6px;
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5),
inset 0 0 2px rgba(255,255,255,0.9);
background-repeat:no-repeat;
width:57px; height:57px;
-webkit-background-size:57px 57px;
margin:0 12px 0 0;
border:1px solid #333;
-webkit-background-clip:padding-box;
}
/**
*
* The 'share' icon for retina display
*
*/
@media all and (-webkit-min-device-pixel-ratio: 2) {
#addToHomeScreen .addToHomeShare {
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAQAAADu6HTYAAADPElEQVR4Xq3TX2gcRRzA8e/M7mVv2+TSNpc/TZtrY6jUGqgaSAmEChKLrYK0YH0RFC2CSCkEfCghiKU04J8qNigq6os+iQV98MHWFwVBrQQRWs21lBw5cw3NNb1/udu72RGG5Y77IzXW77D7sAwf5scyYoL6BGXSDKFZwaGpLvIUaeoCkvX1MmsM0Ny6oRSQYOLuIS+YZOpfQdqslpUxcZrzTVAz4qPwW2O3CeIwC/RSzeY6Ow1QhUrkr+YOWfEKDkEP8Rij7CHKJmrFSDHBdwGEE5wiGChPN+PnT8VdRtEIl1d4gRj/1EVe5ZSBKGh8iqQpo/Fo5+3C/gz0MYg4zgwbqday1/Q4B8BGQ45d/Hi54lakCrU5obOcidJpu1+Lg9whjabyaOYLnrIBFFaRD+xe2ybMDWY66GmP/WA9cGfGp0CWhy0wkMN8inepFiH2rV1j0NQSNQbFLRQnS8/8YSDBBpadfv4CYDub2fmeHDNAsL1MBWUel0iA+Xik6eHcyvD3vAMSU1TGuA/YRS+dD7ovCQN43GKRFCU20Kd3V/avDVVyAZ5niTEuLA5/zBGWg9EEEhfJKN200Tat8CmRAQb9+wv7soPlHt2tQorsz1uPbr0HTY4sJwrH47zJZwABBAKLMBoQXepwgTwdHCo+fXMkQ4lrxEmQ5AaXipPqDY9V2vn09tgvTPI71EEGYxM+/uMJLJ4svpgaWGKOi/xKgmqLSUGSUd5f2vIVJ/CgBaTIUsZ7ZBsn0+NzfMOXLFCXQyTcybN6ep5ZZgUOHn7jpfUpsZshdugPGf+E5zjbyHTSRyQ8xfRPPM/s63RHeuknSoT22mjmmnAOIMkUZ6D1xSfPPAfd1WFKM3sO2CMaHx8M1NjnXKHaAGGkOW0C02WeYHUz4qMtx+w5gUDS8NckYe5lHsMYwCZEPyEEmjLDZFmAS7CDviMdxyTkMNVBKEmYLvbiQQBIBBbCQG04bGQvFWz6CfsCQLWCigILFwcfkGYBiOpbYuOizTAyYyDdCtrGaRG1LCkIgMYEFhI0WqQZoSlbGRyHKe4qOx7iv2bVQW9dp4dlM/x6kmwnWQcd/Q3FCqwTEiT5s+6D5v/pb0SSHyg7uhMWAAAAAElFTkSuQmCC);
}
}
-303
View File
@@ -1,303 +0,0 @@
/* Font Awesome
the iconic font designed for use with Twitter Bootstrap
-------------------------------------------------------
The full suite of pictographic icons, examples, and documentation
can be found at: http://fortawesome.github.com/Font-Awesome/
License
-------------------------------------------------------
The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
http://creativecommons.org/licenses/by/3.0/ A mention of
'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable
source code is considered acceptable attribution (most common on the web).
If human readable source code is not available to the end user, a mention in
an 'About' or 'Credits' screen is considered acceptable (most common in desktop
or mobile software).
Contact
-------------------------------------------------------
Email: dave@davegandy.com
Twitter: http://twitter.com/fortaweso_me
Work: http://lemonwi.se co-founder
*/
@font-face {
font-family: "FontAwesome";
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot?#iefix') format('eot'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg');
font-weight: normal;
font-style: normal;
}
/* Font Awesome styles
------------------------------------------------------- */
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
display: inline-block;
text-decoration: inherit;
}
a [class^="icon-"], a [class*=" icon-"] {
display: inline-block;
text-decoration: inherit;
}
/* makes the font 33% larger relative to the icon container */
.icon-large:before {
vertical-align: top;
font-size: 1.3333333333333333em;
}
.btn [class^="icon-"], .btn [class*=" icon-"] {
/* keeps button heights with and without icons the same */
line-height: .9em;
}
li [class^="icon-"], li [class*=" icon-"] {
display: inline-block;
width: 1.25em;
text-align: center;
}
li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] {
/* 1.5 increased font size for icon-large * 1.25 width */
width: 1.875em;
}
li[class^="icon-"], li[class*=" icon-"] {
margin-left: 0;
list-style-type: none;
}
li[class^="icon-"]:before, li[class*=" icon-"]:before {
text-indent: -2em;
text-align: center;
}
li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before {
text-indent: -1.3333333333333333em;
}
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons */
.icon-glass:before { content: "\f000"; }
.icon-music:before { content: "\f001"; }
.icon-search:before { content: "\f002"; }
.icon-envelope:before { content: "\f003"; }
.icon-heart:before { content: "\f004"; }
.icon-star:before { content: "\f005"; }
.icon-star-empty:before { content: "\f006"; }
.icon-user:before { content: "\f007"; }
.icon-film:before { content: "\f008"; }
.icon-th-large:before { content: "\f009"; }
.icon-th:before { content: "\f00a"; }
.icon-th-list:before { content: "\f00b"; }
.icon-ok:before { content: "\f00c"; }
.icon-remove:before { content: "\f00d"; }
.icon-zoom-in:before { content: "\f00e"; }
.icon-zoom-out:before { content: "\f010"; }
.icon-off:before { content: "\f011"; }
.icon-signal:before { content: "\f012"; }
.icon-cog:before { content: "\f013"; }
.icon-trash:before { content: "\f014"; }
.icon-home:before { content: "\f015"; }
.icon-file:before { content: "\f016"; }
.icon-time:before { content: "\f017"; }
.icon-road:before { content: "\f018"; }
.icon-download-alt:before { content: "\f019"; }
.icon-download:before { content: "\f01a"; }
.icon-upload:before { content: "\f01b"; }
.icon-inbox:before { content: "\f01c"; }
.icon-play-circle:before { content: "\f01d"; }
.icon-repeat:before { content: "\f01e"; }
/* \f020 doesn't work in Safari. all shifted one down */
.icon-refresh:before { content: "\f021"; }
.icon-list-alt:before { content: "\f022"; }
.icon-lock:before { content: "\f023"; }
.icon-flag:before { content: "\f024"; }
.icon-headphones:before { content: "\f025"; }
.icon-volume-off:before { content: "\f026"; }
.icon-volume-down:before { content: "\f027"; }
.icon-volume-up:before { content: "\f028"; }
.icon-qrcode:before { content: "\f029"; }
.icon-barcode:before { content: "\f02a"; }
.icon-tag:before { content: "\f02b"; }
.icon-tags:before { content: "\f02c"; }
.icon-book:before { content: "\f02d"; }
.icon-bookmark:before { content: "\f02e"; }
.icon-print:before { content: "\f02f"; }
.icon-camera:before { content: "\f030"; }
.icon-font:before { content: "\f031"; }
.icon-bold:before { content: "\f032"; }
.icon-italic:before { content: "\f033"; }
.icon-text-height:before { content: "\f034"; }
.icon-text-width:before { content: "\f035"; }
.icon-align-left:before { content: "\f036"; }
.icon-align-center:before { content: "\f037"; }
.icon-align-right:before { content: "\f038"; }
.icon-align-justify:before { content: "\f039"; }
.icon-list:before { content: "\f03a"; }
.icon-indent-left:before { content: "\f03b"; }
.icon-indent-right:before { content: "\f03c"; }
.icon-facetime-video:before { content: "\f03d"; }
.icon-picture:before { content: "\f03e"; }
.icon-pencil:before { content: "\f040"; }
.icon-map-marker:before { content: "\f041"; }
.icon-adjust:before { content: "\f042"; }
.icon-tint:before { content: "\f043"; }
.icon-edit:before { content: "\f044"; }
.icon-share:before { content: "\f045"; }
.icon-check:before { content: "\f046"; }
.icon-move:before { content: "\f047"; }
.icon-step-backward:before { content: "\f048"; }
.icon-fast-backward:before { content: "\f049"; }
.icon-backward:before { content: "\f04a"; }
.icon-play:before { content: "\f04b"; }
.icon-pause:before { content: "\f04c"; }
.icon-stop:before { content: "\f04d"; }
.icon-forward:before { content: "\f04e"; }
.icon-fast-forward:before { content: "\f050"; }
.icon-step-forward:before { content: "\f051"; }
.icon-eject:before { content: "\f052"; }
.icon-chevron-left:before { content: "\f053"; }
.icon-chevron-right:before { content: "\f054"; }
.icon-plus-sign:before { content: "\f055"; }
.icon-minus-sign:before { content: "\f056"; }
.icon-remove-sign:before { content: "\f057"; }
.icon-ok-sign:before { content: "\f058"; }
.icon-question-sign:before { content: "\f059"; }
.icon-info-sign:before { content: "\f05a"; }
.icon-screenshot:before { content: "\f05b"; }
.icon-remove-circle:before { content: "\f05c"; }
.icon-ok-circle:before { content: "\f05d"; }
.icon-ban-circle:before { content: "\f05e"; }
.icon-arrow-left:before { content: "\f060"; }
.icon-arrow-right:before { content: "\f061"; }
.icon-arrow-up:before { content: "\f062"; }
.icon-arrow-down:before { content: "\f063"; }
.icon-share-alt:before { content: "\f064"; }
.icon-resize-full:before { content: "\f065"; }
.icon-resize-small:before { content: "\f066"; }
.icon-plus:before { content: "\f067"; }
.icon-minus:before { content: "\f068"; }
.icon-asterisk:before { content: "\f069"; }
.icon-exclamation-sign:before { content: "\f06a"; }
.icon-gift:before { content: "\f06b"; }
.icon-leaf:before { content: "\f06c"; }
.icon-fire:before { content: "\f06d"; }
.icon-eye-open:before { content: "\f06e"; }
.icon-eye-close:before { content: "\f070"; }
.icon-warning-sign:before { content: "\f071"; }
.icon-plane:before { content: "\f072"; }
.icon-calendar:before { content: "\f073"; }
.icon-random:before { content: "\f074"; }
.icon-comment:before { content: "\f075"; }
.icon-magnet:before { content: "\f076"; }
.icon-chevron-up:before { content: "\f077"; }
.icon-chevron-down:before { content: "\f078"; }
.icon-retweet:before { content: "\f079"; }
.icon-shopping-cart:before { content: "\f07a"; }
.icon-folder-close:before { content: "\f07b"; }
.icon-folder-open:before { content: "\f07c"; }
.icon-resize-vertical:before { content: "\f07d"; }
.icon-resize-horizontal:before { content: "\f07e"; }
.icon-bar-chart:before { content: "\f080"; }
.icon-twitter-sign:before { content: "\f081"; }
.icon-facebook-sign:before { content: "\f082"; }
.icon-camera-retro:before { content: "\f083"; }
.icon-key:before { content: "\f084"; }
.icon-cogs:before { content: "\f085"; }
.icon-comments:before { content: "\f086"; }
.icon-thumbs-up:before { content: "\f087"; }
.icon-thumbs-down:before { content: "\f088"; }
.icon-star-half:before { content: "\f089"; }
.icon-heart-empty:before { content: "\f08a"; }
.icon-signout:before { content: "\f08b"; }
.icon-linkedin-sign:before { content: "\f08c"; }
.icon-pushpin:before { content: "\f08d"; }
.icon-external-link:before { content: "\f08e"; }
.icon-signin:before { content: "\f090"; }
.icon-trophy:before { content: "\f091"; }
.icon-github-sign:before { content: "\f092"; }
.icon-upload-alt:before { content: "\f093"; }
.icon-lemon:before { content: "\f094"; }
.icon-phone:before { content: "\f095"; }
.icon-check-empty:before { content: "\f096"; }
.icon-bookmark-empty:before { content: "\f097"; }
.icon-phone-sign:before { content: "\f098"; }
.icon-twitter:before { content: "\f099"; }
.icon-facebook:before { content: "\f09a"; }
.icon-github:before { content: "\f09b"; }
.icon-unlock:before { content: "\f09c"; }
.icon-credit-card:before { content: "\f09d"; }
.icon-rss:before { content: "\f09e"; }
.icon-hdd:before { content: "\f0a0"; }
.icon-bullhorn:before { content: "\f0a1"; }
.icon-bell:before { content: "\f0a2"; }
.icon-certificate:before { content: "\f0a3"; }
.icon-hand-right:before { content: "\f0a4"; }
.icon-hand-left:before { content: "\f0a5"; }
.icon-hand-up:before { content: "\f0a6"; }
.icon-hand-down:before { content: "\f0a7"; }
.icon-circle-arrow-left:before { content: "\f0a8"; }
.icon-circle-arrow-right:before { content: "\f0a9"; }
.icon-circle-arrow-up:before { content: "\f0aa"; }
.icon-circle-arrow-down:before { content: "\f0ab"; }
.icon-globe:before { content: "\f0ac"; }
.icon-wrench:before { content: "\f0ad"; }
.icon-tasks:before { content: "\f0ae"; }
.icon-filter:before { content: "\f0b0"; }
.icon-briefcase:before { content: "\f0b1"; }
.icon-fullscreen:before { content: "\f0b2"; }
.icon-group:before { content: "\f0c0"; }
.icon-link:before { content: "\f0c1"; }
.icon-cloud:before { content: "\f0c2"; }
.icon-beaker:before { content: "\f0c3"; }
.icon-cut:before { content: "\f0c4"; }
.icon-copy:before { content: "\f0c5"; }
.icon-paper-clip:before { content: "\f0c6"; }
.icon-save:before { content: "\f0c7"; }
.icon-sign-blank:before { content: "\f0c8"; }
.icon-reorder:before { content: "\f0c9"; }
.icon-list-ul:before { content: "\f0ca"; }
.icon-list-ol:before { content: "\f0cb"; }
.icon-strikethrough:before { content: "\f0cc"; }
.icon-underline:before { content: "\f0cd"; }
.icon-table:before { content: "\f0ce"; }
.icon-magic:before { content: "\f0d0"; }
.icon-truck:before { content: "\f0d1"; }
.icon-pinterest:before { content: "\f0d2"; }
.icon-pinterest-sign:before { content: "\f0d3"; }
.icon-google-plus-sign:before { content: "\f0d4"; }
.icon-google-plus:before { content: "\f0d5"; }
.icon-money:before { content: "\f0d6"; }
.icon-caret-down:before { content: "\f0d7"; }
.icon-caret-up:before { content: "\f0d8"; }
.icon-caret-left:before { content: "\f0d9"; }
.icon-caret-right:before { content: "\f0da"; }
.icon-columns:before { content: "\f0db"; }
.icon-sort:before { content: "\f0dc"; }
.icon-sort-down:before { content: "\f0dd"; }
.icon-sort-up:before { content: "\f0de"; }
.icon-envelope-alt:before { content: "\f0e0"; }
.icon-linkedin:before { content: "\f0e1"; }
.icon-undo:before { content: "\f0e2"; }
.icon-legal:before { content: "\f0e3"; }
.icon-dashboard:before { content: "\f0e4"; }
.icon-comment-alt:before { content: "\f0e5"; }
.icon-comments-alt:before { content: "\f0e6"; }
.icon-bolt:before { content: "\f0e7"; }
.icon-sitemap:before { content: "\f0e8"; }
.icon-umbrella:before { content: "\f0e9"; }
.icon-paste:before { content: "\f0ea"; }
.icon-user-md:before { content: "\f200"; }
-519
View File
@@ -1,519 +0,0 @@
/* WARNING: Your are using ligatures for your icon font.
Ligatures are not supported in IE 9 (and older).
Use the Private Use Area encoding for best browser support.
==================================================================== */
@font-face {
font-family: 'entypo';
src:url(<%= asset_path 'entypo.eot' %>);
src:url(<%= asset_path 'entypo.eot?#iefix' %>) format('embedded-opentype'),
url(<%= asset_path 'entypo.svg#entypo' %>) format('svg'),
url(<%= asset_path 'entypo.woff' %>) format('woff'),
url(<%= asset_path 'entypo.ttf' %>) format('truetype');
font-weight: normal;
font-style: normal;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icons]:before {
font-family: 'entypo';
content: attr(data-icon);
speak: none;
/* Enable Ligatures */
-webkit-font-feature-settings:"liga","dlig";
-moz-font-feature-settings:"liga=1, dlig=1";
-moz-font-feature-settings:"liga","dlig";
-ms-font-feature-settings:"liga","dlig";
-o-font-feature-settings:"liga","dlig";
font-feature-settings:"liga","dlig";
text-rendering:optimizeLegibility;
font-weight: normal;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
[class^="icons-"]:before, [class*=" icons-"]:before {
font-size: 1.5em;
font-family: 'entypo';
font-style: normal;
speak: none;
/* Enable Ligatures */
-webkit-font-feature-settings:"liga","dlig";
-moz-font-feature-settings:"liga=1, dlig=1";
-moz-font-feature-settings:"liga","dlig";
-ms-font-feature-settings:"liga","dlig";
-o-font-feature-settings:"liga","dlig";
font-feature-settings:"liga","dlig";
text-rendering:optimizeLegibility;
font-weight: normal;
-webkit-font-smoothing: antialiased;
display: inline-block;
text-decoration: inherit;
}
a [class^="icons-"], a [class*=" icons-"] {
display: inline-block;
text-decoration: inherit;
}
/* makes the font 33% larger relative to the icon container */
.icons-large:before {
vertical-align: top;
font-size: 1.3333333333333333em;
}
.btn [class^="icons-"], .btn [class*=" icons-"] {
/* keeps button heights with and without icons the same */
line-height: .9em;
}
li [class^="icons-"], li [class*=" icons-"] {
display: inline-block;
width: 1.25em;
text-align: center;
margin-right: 10px;
}
li .icons-large[class^="icons-"], li .icons-large[class*=" icons-"] {
/* 1.5 increased font size for icons-large * 1.25 width */
width: 1.875em;
}
li[class^="icons-"], li[class*=" icons-"] {
margin-left: 0;
list-style-type: none;
}
li[class^="icons-"]:before, li[class*=" icons-"]:before {
text-indent: -2em;
text-align: center;
}
li[class^="icons-"].icons-large:before, li[class*=" icons-"].icons-large:before {
text-indent: -1.3333333333333333em;
}
.icons-phone:before {
content: "\70\68\6f\6e\65";
}
.icons-directions:before {
content: "\64\69\72\65\63\74\69\6f\6e\73";
}
.icons-mail:before {
content: "\6d\61\69\6c";
}
.icons-pencil:before {
content: "\70\65\6e\63\69\6c";
}
.icons-paperclip:before {
content: "\70\61\70\65\72\63\6c\69\70";
}
.icons-drawer:before {
content: "\64\72\61\77\65\72";
}
.icons-member:before {
content: "\6d\65\6d\62\65\72";
}
.icons-group:before {
content: "\67\72\6f\75\70";
}
.icons-addmember:before {
content: "\61\64\64\6d\65\6d\62\65\72";
}
.icons-location:before {
content: "\6c\6f\63\61\74\69\6f\6e";
}
.icons-share:before {
content: "\73\68\61\72\65";
}
.icons-heart-full:before {
content: "\68\65\61\72\74\2d\66\75\6c\6c";
}
.icons-heart-bare:before {
content: "\68\65\61\72\74\2d\62\61\72\65";
}
.icons-star-full:before {
content: "\73\74\61\72\2d\66\75\6c\6c";
}
.icons-star-bare:before {
content: "\73\74\61\72\2d\62\61\72\65";
}
.icons-discuss:before {
content: "\64\69\73\63\75\73\73";
}
.icons-comment:before {
content: "\63\6f\6d\6d\65\6e\74";
}
.icons-quote:before {
content: "\71\75\6f\74\65";
}
.icons-house:before {
content: "\68\6f\75\73\65";
}
.icons-search:before {
content: "\73\65\61\72\63\68";
}
.icons-printer:before {
content: "\70\72\69\6e\74\65\72";
}
.icons-bell:before {
content: "\62\65\6c\6c";
}
.icons-link:before {
content: "\6c\69\6e\6b";
}
.icons-flag:before {
content: "\66\61\6c\67";
}
.icons-cog:before {
content: "\63\6f\67";
}
.icons-tools:before {
content: "\74\6f\6f\6c\73";
}
.icons-tag:before {
content: "\74\61\67";
}
.icons-camera:before {
content: "\63\61\6d\65\72\61";
}
.icons-megaphone:before {
content: "\6d\65\67\61\70\68\6f\6e\65";
}
.icons-new:before {
content: "\6e\65\77";
}
.icons-graduation:before {
content: "\67\72\61\64\75\61\74\69\6f\6e";
}
.icons-books:before {
content: "\62\6f\6f\6b\73";
}
.icons-page:before {
content: "\70\61\67\65";
}
.icons-lifebuoy:before {
content: "\6c\69\66\65\62\75\6f\79";
}
.icons-eye:before {
content: "\65\79\65";
}
.icons-clock:before {
content: "\63\6c\6f\63\6b";
}
.icons-calendar:before {
content: "\63\61\6c\65\6e\64\61\72";
}
.icons-briefcase:before {
content: "\62\72\69\65\66\63\61\73\65";
}
.icons-gauge:before {
content: "\67\61\75\67\65";
}
.icons-language:before {
content: "\6c\61\6e\67\75\61\67\65";
}
.icons-keys:before {
content: "\6b\65\79\73";
}
.icons-earth:before {
content: "\65\61\72\74\68";
}
.icons-keyboard:before {
content: "\6b\65\79\62\6f\61\72\64";
}
.icons-browser:before {
content: "\62\72\6f\77\73\65\72";
}
.icons-publish:before {
content: "\70\75\62\6c\69\73\68";
}
.icons-code:before {
content: "\63\6f\64\65";
}
.icons-light-bulb:before {
content: "\6c\69\67\68\74\2d\62\75\6c\62";
}
.icons-database:before {
content: "\64\61\74\61\62\61\73\65";
}
.icons-box:before {
content: "\62\6f\78";
}
.icons-rss:before {
content: "\72\73\73";
}
.icons-clipboard:before {
content: "\63\6c\69\70\62\6f\61\72\64";
}
.icons-cart:before {
content: "\63\61\72\74";
}
.icons-untitled:before {
content: "\75\6e\74\69\74\6c\65\64";
}
.icons-statistics:before {
content: "\73\74\61\74\69\73\74\69\63\73";
}
.icons-pie:before {
content: "\70\69\65";
}
.icons-bars:before {
content: "\62\61\72\73";
}
.icons-graph:before {
content: "\67\72\61\70\68";
}
.icons-lock:before {
content: "\6c\6f\63\6b";
}
.icons-unlock:before {
content: "\75\6e\6c\6f\63\6b";
}
.icons-outlog:before {
content: "\6f\75\74\6c\6f\67";
}
.icons-inlog:before {
content: "\69\6e\6c\6f\67";
}
.icons-checkmark:before {
content: "\63\68\65\63\6b\6d\61\72\6b";
}
.icons-aminus:before {
content: "\61\6d\69\6e\75\73";
}
.icons-aplus:before {
content: "\61\70\6c\75\73";
}
.icons-aclose:before {
content: "\61\63\6c\6f\73\65";
}
.icons-bminus:before {
content: "\62\6d\69\6e\75\73";
}
.icons-bplus:before {
content: "\62\70\6c\75\73";
}
.icons-bclose:before {
content: "\62\63\6c\6f\73\65";
}
.icons-cminus:before {
content: "\63\6d\69\6e\75\73";
}
.icons-cplus:before {
content: "\63\70\6c\75\73";
}
.icons-cross:before {
content: "\63\72\6f\73\73";
}
.icons-blocked:before {
content: "\62\6c\6f\63\6b\65\64";
}
.icons-information:before {
content: "\69\6e\66\6f\72\6d\61\74\69\6f\6e";
}
.icons-binfo:before {
content: "\62\69\6e\66\6f";
}
.icons-question:before {
content: "\71\75\65\73\74\69\6f\6e";
}
.icons-help:before {
content: "\68\65\6c\70";
}
.icons-warning:before {
content: "\77\61\72\6e\69\6e\67";
}
.icons-shuffle:before {
content: "\73\68\75\66\66\6c\65";
}
.icons-return:before {
content: "\72\65\74\75\72\6e";
}
.icons-enter:before {
content: "\65\6e\74\65\72";
}
.icons-exchange:before {
content: "\65\78\63\68\61\6e\67\65";
}
.icons-loop:before {
content: "\6c\6f\6f\70";
}
.icons-th-list:before {
content: "\74\68\2d\6c\69\73\74";
}
.icons-th-large:before {
content: "\74\68\2d\6c\61\72\67\65";
}
.icons-align-justify:before {
content: "\61\6c\69\67\6e\2d\6a\75\73\74\69\66\79";
}
.icons-wtext:before {
content: "\77\74\65\78\74";
}
.icons-btext:before {
content: "\62\74\65\78\74";
}
.icons-pictures:before {
content: "\70\69\63\74\75\72\65";
}
.icons-video:before {
content: "\76\69\64\65\6f";
}
.icons-music:before {
content: "\6d\6f\75\73\65";
}
.icons-folder:before {
content: "\66\6f\6c\64\65\72";
}
.icons-archive:before {
content: "\61\72\63\68\69\76\65";
}
.icons-trash:before {
content: "\74\72\61\73\68";
}
.icons-upload:before {
content: "\75\70\6c\6f\61\64";
}
.icons-download:before {
content: "\64\6f\77\6e\6c\6f\61\64";
}
.icons-disk:before {
content: "\64\69\73\6b";
}
.icons-bookmark:before {
content: "\62\6f\6f\6b\6d\61\72\6b";
}
.icons-booma:before {
content: "\62\6f\6f\6d\61";
}
.icons-resize-enlarge:before {
content: "\72\65\73\69\7a\65\2d\65\6e\6c\61\72\67\65";
}
.icons-resize-shrink:before {
content: "\72\65\73\69\7a\65\2d\73\68\72\69\6e\6b";
}
.icons-flow-tree:before {
content: "\66\6c\6f\77\2d\74\72\65\65";
}
.icons-arrow-left-a:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\61";
}
.icons-arrow-bottom-a:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\61";
}
.icons-arrow-top-a:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\61";
}
.icons-arrow-right-a:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\61";
}
.icons-arrow-left-b:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\62";
}
.icons-arrow-bottom-b:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\62";
}
.icons-arrow-top-b:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\62";
}
.icons-arrow-right-b:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\62";
}
.icons-arrow-left-c:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\63";
}
.icons-arrow-bottom-c:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\63";
}
.icons-arrow-top-c:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\63";
}
.icons-arrow-right-c:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\63";
}
.icons-arrow-left-d:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\64";
}
.icons-arrow-bottom-d:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\64";
}
.icons-arrow-top-d:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\64";
}
.icons-arrow-right-d:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\64";
}
.icons-arrow-left-e:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\65";
}
.icons-arrow-bottom-e:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\65";
}
.icons-arrow-top-e:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\65";
}
.icons-arrow-right-e:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\65";
}
.icons-arrow-left-f:before {
content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\66";
}
.icons-arrow-bottom-f:before {
content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\66";
}
.icons-arrow-top-f:before {
content: "\61\72\72\6f\77\2d\74\6f\70\2d\66";
}
.icons-left-f:before {
content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\66";
}
.icons-menu:before {
content: "\6d\65\6e\75";
}
.icons-ellipsis:before {
content: "\65\6c\6c\69\70\73\69\73";
}
.icons-dots:before {
content: "\64\6f\74\73";
}
.icons-dot:before {
content: "\64\6f\74";
}
.icons-like:before {
content: "\6c\69\6b\65";
}
.icons-suck:before {
content: "\73\75\63\6b";
}
.icons-export:before {
content: "\65\78\70\6f\72\74";
}
.icons-vcard:before {
content: "\76\63\61\72\64";
}
.icons-flow-cascade:before {
content: "\21";
}
.icons-landscape:before {
content: "\22";
}
.icons-brush:before {
content: "\62\72\75\73\68";
}
.icons-palette:before {
content: "\70\61\6c\65\74\74\65";
}
.icons-desktop:before {
content: "\64\65\73\6b\74\6f\70";
}
.icons-plane:before {
content: "\70\6c\61\6e\65";
}
.icons-booklet:before {
content: "\62\6f\6f\6b\6c\65\74";
}
.icons-update:before {
content: "\75\70\64\61\74\65";
}
.icons-reload:before {
content: "\72\65\6c\6f\61\64";
}
.icons-unload:before {
content: "\75\6e\6c\6f\61\64";
}
.icons-trophy:before {
content: "\74\72\6f\70\68\79";
}
File diff suppressed because it is too large. Load diff
@@ -1,374 +0,0 @@
a {
text-decoration: none;
}
div[data-role="page"] {
padding-bottom: 0!important;
}
.clear:after {
clear: both;
content: "";
display: block;
height: 0;
visibility: hidden;
}
.main-menu {
display: block;
position: fixed;
width: 100%;
left: 0;
top: -50px;
display: block;
z-index: 49;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
}
.main-menu.expanded {
top: 50px;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
}
.main-menu ul {
background-color: #333;
width: 210px;
list-style: none;
margin: 0 auto;
padding: 0;
-webkit-box-shadow: 0 3px 10px rgba(0,0,0,.8), inset 0 3px 15px rgba(0,0,0,.3);;
-webkit-border-radius: 0 0 10px 10px;
}
.main-menu ul li {
float: left;
width: 58px;
border-right: 1px solid #292929;
border-left: 1px solid #3F3F3F;
padding: 0 5px;
}
.main-menu ul li:last-child {
-webkit-border-radius: 0 0 10px 0;
border-right-color: transparent;
}
.main-menu ul li:first-child {
-webkit-border-radius: 0 0 0 10px;
border-left-color: transparent;
}
.main-menu ul li:hover {
background-color: #b4111a;
}
.main-menu ul i {
font-size: 1.4em;
width: 100%;
display: block;
margin: 10px auto 0;
}
.main-menu ul span {
display: block;
margin-bottom: 10px;
text-align: center;
}
.main-menu ul li a:link, .main-menu ul li a:visited {
font-size: .6em;
color: #DFDFDF!important;
text-shadow: 0 -1px 0px #000;
text-decoration: none;
display: block;
}
.main-menu ul li a:hover, .main-menu ul li a:active {
color: #DFDFDF!important;
}
.global {
position: relative;
background-color: #333;
overflow-x: hidden;
width: 100%;
-webkit-box-shadow: -3px 0px 15px rgba(0,0,0,.5);
padding-top: 50px;
padding-bottom: 64px;
/*margin-bottom: -64px;*/
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #000;
padding: 0;
border: none;
z-index: 50;
/*background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));*/
background-image: -webkit-linear-gradient(top, #5282A6, #133757);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset;
}
.header h1.ui-title {
margin: 8px 30%;
position: relative;
}
.header i.openmenu {
position: absolute;
display: block;
top: 40px;
left: 50%;
margin-left: -15px;
font-size: 20px;
/*color: #727272;*/
color: #7CA6C5;
/*background-color: #252525;*/
background-color: #144366;
border-radius: 0 0 5px 5px;
height: 15px;
line-height: 16px;
box-shadow: 1px 2px 2px rgba(0, 0, 0, .5);
}
.header .language .ui-btn-text {
left: 0;
}
.header .language .ui-btn-text i {
font-size: 1.1em;
margin-top: .33em;
}
.header .language .ui-icon {
background-image: none;
}
.header .ui-btn-up-a {
border: 1px solid #133547;
background-color: #0C4C64;
background-image: -webkit-gradient(linear, left top, left bottom, from( #0D6691 ), to( #0E3A4B ));
background-image: -webkit-linear-gradient( #0D6691 , #0E3A4B );
background-image: -moz-linear-gradient( #0D6691 , #0E3A4B );
background-image: -ms-linear-gradient( #0D6691 , #0E3A4B );
background-image: -o-linear-gradient( #0D6691 , #0E3A4B );
background-image: linear-gradient( #0D6691 , #0E3A4B );
}
.header h1 img {
height: 30px;
width: auto;
}
.header.ui-header > .ui-btn {
margin-top: 6px;
}
.content {
position: relative;
background-color: #FFF;
min-height: 330px;
background: url(<%= asset_path "mobile/newlist-bg.jpg" %>) repeat 0 0 transparent;
}
/*.content .list {
position: relative;
z-index: 5;
box-shadow: -5px 0px 15px rgba(0,0,0,.8)
}*/
.content .newlist {
margin: 0 auto;
padding: 10px;
}
.content .newitem {
display: inline-block;
float: left;
width: 280px;
min-height: 490px;
max-height: 490px;
background-color: #FFFFFF;
padding: 10px;
margin: 0 10px 10px 0;
box-shadow: 0px 3px 5px rgba(0,0,0,.1);
}
#index .content .newpic {
width: 280px;
height: 200px;
margin: 0 auto;
}
#index .content .newstitle {
font-size: 1.4em;
margin: 1em 0;
}
#index .content .newsDate {
font-size: 1em;
color: #8D8D8D;
}
#index .content .newsummary {
padding: 0 0 20px;
margin-bottom: 0;
}
#announcement_content .content .newpic {
width: 320px;
height: 220px;
margin: 0 auto;
}
#announcement_content .content .newstitle {
font-size: 1.4em;
padding: 0 10px;
margin: 1em 0;
}
#announcement_content .content .newsDate {
padding: 0 10px;
font-size: 1em;
color: #8D8D8D;
}
#announcement_content .content .newsummary {
padding: 0 10px 20px;
margin-bottom: 0;
}
#announcement_content .content {
padding: 10px;
}
#map div[data-role="content"] {
padding: 0;
}
#map .global {
padding: 0;
}
#page_content .global {
overflow-x: auto;
-webkit-box-shadow: none;
background-color: #f9f9f9;
}
#page_content .content {
background-image: none;
padding: 10px;
background-color: #f9f9f9;
}
#page_content .content .newsummary > * {
width: 750px!important;
}
#page_content .content .newsummary > *:after {
clear: both;
height: 0;
display: block;
content: "";
visibility: hidden;
}
div[id^="dialog"] .global {
padding: 0;
}
div[id^="dialog"] .content {
padding: 10px;
height: auto!important;
min-height: 70px;
}
/*.content .newitem:first-child {
margin-left: 0;
}
.content .newitem:last-child {
margin-right: 0;
}*/
.pagination {
height: 36px;
margin: 18px 0 0;
padding-bottom: 18px;
text-align: center;
}
.pagination ul {
padding: 0;
display: inline-block;
margin-left: 0;
margin: 0;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pagination li {
display: inline;
}
.pagination li:first-child a {
border-left-width: 1px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.pagination li:last-child a {
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.pagination .active a {
color: #999;
cursor: default;
}
.pagination a:hover, .pagination .active a {
background-color: #E8E8E8;
}
.pagination a {
background-color: white;
}
.pagination a {
float: left;
padding: 0 10px;
line-height: 30px;
text-decoration: none;
border: 1px solid #DDD;
border-left-width: 0;
font-size: .8em;
}
.footer {
color: #999;
/*background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c));*/
background-image: -webkit-linear-gradient(top, #5282A6, #133757);
}
.footer div[data-role="navbar"] i {
display: block;
width: 100%;
margin-bottom: 5px;
}
@media(min-width:320px){
}
@media(min-width: 480px){
.content .newitem {
width: 440px;
}
}
@media(min-width:600px) {
.main-menu ul {
width: 420px;
}
.main-menu ul li {
width: 128px;
}
}
@media(min-width:768px) {
.main-menu ul {
width: 480px;
}
.main-menu ul li {
width: 148px;
}
.content .newitem {
width: 280px;
}
}
@media(min-width:800px) {
.main-menu ul {
width: 480px;
}
.main-menu ul li {
width: 148px;
}
}
@media(min-width:961px) {
.main-menu ul {
width: 480px;
}
.main-menu ul li {
width: 148px;
}
}
@media(min-width: 1024px) {
.main-menu ul {
width: 600px;
}
.main-menu ul li {
width: 188px;
}
.content .newitem {
width: 280px;
}
}
@media(min-width:1280px) {
}
+29 -17
View File
@@ -1,10 +1,17 @@
class Admin::AdBannersController < OrbitBackendController
open_for_visitor :only => [:index, :show]
open_for_sub_manager
open_for_manager :except => [:index,:show,:update,:realtime_preview]
open_for_sub_manager :except => [:index, :show]
def index
@ad_banners = AdBanner.all.page(params[:page]).per(10)
def rename
@ad_banner = AdBanner.find(params[:id])
@ad_banner.title = params[:body]
render :json => {:success =>@ad_banner.save!}
end
def destroy
@ad_banner = AdBanner.find(params[:id])
@ad_banner.destroy
redirect_to admin_ad_banners_url
end
def show
@@ -21,31 +28,36 @@ class Admin::AdBannersController < OrbitBackendController
def create
@ad_banner = AdBanner.new(params[:ad_banner])
if @ad_banner.save
@active = @ad_banner
redirect_to admin_ad_banners_url
#respond_to do |format|
# format.js {render 'new_created_node'}
#end
else
@ad_banner = AdBanner.new(params[:ad_banner])
render :new
render 'create_error_msg'
end
end
def edit
@ad_banner = AdBanner.find(params[:id])
render layout: false
end
def update
@ad_banner = AdBanner.find(params[:id])
if @ad_banner.update_attributes(params[:ad_banner])
redirect_to admin_ad_banners_url, :status => 303
else
render :edit
end
end
def destroy
@ad_banner = AdBanner.find(params[:id])
@ad_banner.destroy
@ad_banner.update_attributes(params[:ad_banner])
@ad_banner.save
redirect_to admin_ad_banners_url
end
def realtime_preview
@ad_banner = AdBanner.find( params[:id] ).preview_clone
@ad_banner.update_attributes(params[:ad_banner])#.update_attributes(params[:ad_images])
end
def index
@ad_banners = AdBanner.all
@active = @ad_banners.first
@tags = get_tags
end
end
+32 -26
View File
@@ -1,56 +1,62 @@
class Admin::AdImagesController < Admin::AdBannersController
before_filter :only => [ :new, :edit ] do
@ad_banners = AdBanner.all
@tags = get_tags
end
# before_filter :force_order_for_user
# before_filter :for_app_sub_manager
# before_filter :for_app_manager
def initialize
super
@app_title = "ad_banner"
end
def index
@ad_images = AdImage.all.page(params[:page]).per(10)
#@ad_banner = AdBanner.find params[:ad_banner_id]
#@ad_images = @ad_banner.ad_images.all.page(params[:page]).per(10)
@ad_images = AdImage.all.page(params[:page]).per(10)
end
def edit
#@ad_banner = AdBanner.find params[:ad_banner_id]
@ad_image = AdImage.find(params[:id])
@tags = get_tags
end
def update
@ad_image = AdImage.find(params[:id])
if @ad_image.update_attributes(params[:ad_image])
redirect_to admin_ad_images_url
else
@ad_banners = AdBanner.all
@tags = get_tags
render action: :edit
end
@ad_banner = AdBanner.find params[:ad_banner][:id]
@ad_image = AdImage.find(params[:ad_image][:id])
@ad_image.update_attributes(params[:ad_image])
@ad_banner.ad_images << @ad_image
redirect_to admin_ad_images_path
end
def new
def new
#ad_banner = AdBanner.find params[:ad_banner_id]
#@ad_image =ad_banner.ad_images.build
@ad_image = AdImage.new
@ad_image.postdate = Date.today
@ad_image.deadline = Date.today + 30
@ad_image.post_date = Date.today
@ad_image.unpost_date = Date.today + 30
@tags = get_tags
#render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil}
end
def create
@ad_image = AdImage.new(params[:ad_image])
@ad_banner = AdBanner.find params[:ad_banner][:id]
@ad_image = AdImage.new params[:ad_image]
@ad_image.to_save = true
@ad_banner.ad_images << @ad_image
if @ad_image.save
redirect_to admin_ad_images_url
else
@ad_banners = AdBanner.all
@tags = get_tags
@ad_image = AdImage.new(params[:ad_image])
render action: :new
redirect_to admin_ad_images_path
end
end
def destroy
#@ad_banner = AdBanner.find params[:ad_banner_id]
@ad_image = AdImage.find params[:id]
if @ad_image.destroy
redirect_to admin_ad_images_url
flash[:notice] = t('ad.success_destroy_ad_image')
redirect_to admin_ad_images_path
end
end
@@ -34,30 +34,38 @@ class Admin::AuthorizationsController < OrbitBackendController
end
def add_roles
roles = Role.find(params[:role_ids]) rescue nil
unless roles.nil?
roles = Role.find(params[:role_ids]) rescue []
users = []
roles.each do |role|
users += role.users.all.entries
end
unless roles.blank?
authorization = get_or_create_authorization
add_roles_to_auth(authorization, roles)
add_roles_to_auth(authorization, roles) unless @error
end
@users = authorization.authorized_users
render 'admin/authorizations/reload_users'
end
def add_sub_roles
sub_roles = SubRole.find(params[:sub_role_ids]) rescue nil
unless sub_roles.nil?
sub_roles = SubRole.find(params[:sub_role_ids]) rescue []
users = []
sub_roles.each do |sub_role|
users += sub_role.users.all.entries
end
unless sub_roles.blank?
authorization = get_or_create_authorization
add_sub_roles_to_auth(authorization, sub_roles)
add_sub_roles_to_auth(authorization, sub_roles) unless @error
end
@users = authorization.authorized_users
render 'admin/authorizations/reload_users'
end
def add_users
users = User.find(params[:user_ids]) rescue nil
unless users.nil?
users = User.find(params[:user_ids]) rescue []
unless users.blank?
authorization = get_or_create_authorization
add_users_to_auth(authorization, users)
add_users_to_auth(authorization, users) unless @error
end
@users = authorization.authorized_users
render 'admin/authorizations/reload_users'
@@ -112,6 +120,10 @@ class Admin::AuthorizationsController < OrbitBackendController
protected
def add_managers_to_auth(users)
@module_app.add_managers(users)
end
def add_roles_to_auth(authorization, roles)
authorization.add_roles(roles)
end
@@ -139,7 +151,7 @@ class Admin::AuthorizationsController < OrbitBackendController
@error = t(:no_data)
end
when nil
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: @module_app.key)
@module_app.auth_manager || @module_app.create_auth_manager(module_app_id: @module_app.id, title: "#{@type}_#{@module_app.key}")
else
auth = @object.get_authorization_by_title("#{@type}_#{@module_app.key}")
unless auth
@@ -150,6 +162,10 @@ class Admin::AuthorizationsController < OrbitBackendController
end
end
def remove_managers_from_auth(users)
@module_app.remove_manager(users)
end
def remove_roles_form_auth(authorization, roles)
authorization.remove_roles(roles)
end
@@ -1,6 +1,12 @@
class Admin::CategoriesController < OrbitBackendController
open_for_manager
# TODO = put back ========================
# before_filter :force_order_for_visitor, only: [:index]
# before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index]
# ========================================
before_filter :setup_vars
# ========================================
def index
@categories = get_categories_for_index
@@ -31,7 +37,7 @@ class Admin::CategoriesController < OrbitBackendController
def update
@category = Category.find(params[:id])
if @category.update_attributes(params[:category])
redirect_to admin_module_app_categories_url(@module_app_id), :status => 303
redirect_to admin_module_app_categories_url(@module_app_id)
else
flash.now[:error] = t('update.error.category')
render action: :edit
+6 -1
View File
@@ -2,7 +2,12 @@ class Admin::ItemsController < OrbitBackendController
layout "structure"
open_for_admin
# TODO = put back ========================
# before_filter :authenticate_user!
# before_filter :find_parent_item
# before_filter :is_admin?
# before_filter :set_current_item
#=========================================
def index
if params[:item_id]
@@ -1,5 +1,9 @@
class Admin::LinksController < Admin::ItemsController
def show
@item ||= Link.find(params[:id])
end
def new
@item = Link.new
@item.parent = Page.find(params[:parent_id]) rescue nil
@@ -1,7 +1,13 @@
class Admin::ModuleTagsController < OrbitBackendController
include OrbitTag::Merging
open_for_manager
# TODO = put back ========================
# before_filter :force_order_for_visitor, only: [:index]
# before_filter :force_order_for_user, except: [:index]
# before_filter :for_app_sub_manager, except: [:index]
# ========================================
before_filter :setup_vars
# ========================================
helper 'admin/tags'
@@ -27,7 +33,6 @@ class Admin::ModuleTagsController < OrbitBackendController
redirect_to admin_module_tags_url(module_app_id: @module_app_id)
else
@tag = ModuleTag.new(params[:module_tag])
flash.now[:error] = t('create.error.tag')
render :action => "new"
end
end
@@ -37,7 +42,6 @@ class Admin::ModuleTagsController < OrbitBackendController
if @tag.update_attributes(params[:module_tag])
redirect_to admin_module_tags_url(module_app_id: @module_app_id)
else
flash.now[:error] = t('update.error.tag')
render :action => "edit"
end
end
+1 -2
View File
@@ -5,8 +5,7 @@ class Admin::PagesController < Admin::ItemsController
def show
@item = Page.find(params[:id])
@no_orbit_bar = true
@edit = true
render :text => parse_page_content(@item), :layout => 'page_layout'
render layout: 'page_layout'
end
def new
+1 -1
View File
@@ -60,7 +60,7 @@ class Admin::SitesController < OrbitBackendController
end
def preference
end
+1 -4
View File
@@ -1,8 +1,5 @@
class Admin::TagsController < OrbitBackendController
include OrbitTag::Merging
open_for_user only: [:index]
open_for_manager
def index
@tags = @module_app.module_tags
@@ -33,7 +30,7 @@ class Admin::TagsController < OrbitBackendController
def update
@tag = ModuleTag.find(params[:id])
if @tag.update_attributes(params[:module_tag])
redirect_to action: :index, :status => 303
redirect_to action: :index
else
flash.now[:error] = t('update.error.tag')
render :action => "edit"
@@ -4,7 +4,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
helper OrbitBackendHelper
before_filter :set_attribute,:except => [:index,:show]
open_for_user :only => [:setting_account, :edit_user_data, :update]
open_for_visitor :only => [:index, :show]
def index
@@ -182,46 +181,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
def edit_passwd
# @disable_all_field = false
@user = User.find(params[:users_new_interface_id])
if current_user.id == @user.id
redirect_to :action => :index
end
end
def edit_privilege
@user = User.find(params[:users_new_interface_id])
if current_user.id == @user.id
redirect_to :action => :index
end
end
def edit_user_data
if params[:users_new_interface_id].blank?
redirect_to :action => :index
else
@user = User.find(params[:users_new_interface_id])
if current_user.id != @user.id
redirect_to :action => :index
end
@form_index = 0
get_info_and_roles
end
end
def setting_account
if params[:users_new_interface_id].blank?
redirect_to :action => :index
else
@user = User.find(params[:users_new_interface_id])
if current_user.id != @user.id
redirect_to :action => :index
end
end
end
def update
@@ -244,49 +203,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
render :action => :edit_passwd, :notice => flash.now[:error]
end
elsif params[:edit_type] == 'edit_user_data'
if current_user.id != @user.id
redirect_to :action => :index
end
@user.update_attributes(params[:user])
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
attribute_values = params[:user].delete(attribute_values_key)
@user.save
redirect_to :action => :show
elsif params[:edit_type] == 'setting_account'
if current_user.id != @user.id
redirect_to :action => :index
end
if !@user.valid_password?(params[:old_password])
flash.now[:error] = t("users.valid_old_password")
end
if !flash.now[:error] && @user.update_attributes(params[:user])
redirect_to :action => :show
else
render :action => :setting_account, :notice => flash.now[:error]
end
elsif params[:edit_type] == 'edit_privilege'
if @user.admin && current_user.id == @user.id
flash.now[:error] = t("users.admin_change_password")
end
if !flash.now[:error] && @user.update_attributes(params[:user])
redirect_to :action => :show
else
render :action => :edit_privilege, :notice => flash.now[:error]
end
else
@user.update_attributes(params[:user])
+6 -10
View File
@@ -140,21 +140,17 @@ class ApplicationController < ActionController::Base
# update session if passed
session[:locale] = params[:locale] if params[:locale]
browser_locale = condition = nil
default_locale = condition = nil
# check if locale is valid for non site pages
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
condition = VALID_LOCALES.include?(session[:locale])
#check if the default locale is present or not
elsif @site.default_locale.present?
default_locale = @site.default_locale
condition = @site.in_use_locales.include?(default_locale)
elsif !@site.enable_language_detection
#check enable langauge detection
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
condition = @site.in_use_locales.include?(browser_locale)
elsif session[:locale]
condition = @site.in_use_locales.include?(session[:locale])
elsif @site.default_locale.present?
default_locale = @site.default_locale
condition = @site.valid_locales.include?(default_locale)
else
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
condition = @site.in_use_locales.include?(browser_locale)
end
session[:locale] = condition ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
I18n.locale = session[:locale].to_sym
+2 -3
View File
@@ -340,11 +340,10 @@ class DesktopController< ApplicationController
render :json=>b.to_json
end
protected
private
def check_desktop_open
@site = Site.first
if @site.desktop_closed #Need to be change
if Me.desktop_closed && current_user.nil? #Need to be change
redirect_to '/admin/dashboards'
end
end
-6
View File
@@ -26,13 +26,7 @@ class PagesController < ApplicationController
when 'Page'
if params[:clicked_field_name]
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
elsif params[:edit]
if request.referer && request.referer.ends_with?("admin/items")
redirect_to admin_page_url(@item)
else
render :file => "#{Rails.root}/public/403.html", :status => 403
end
else
render_page(params.except(:controller, :action, :page_name)) unless save_from_no_lang_for_page
end
when 'Link'
+31
View File
@@ -0,0 +1,31 @@
module Admin::AdBannersHelper
def preview_block_ad_images_helper(ad_banner)
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
if ad_image.display?
ad_image.weight.times do
printable_ad_images << ad_image
end
end
end
printable_ad_images.shuffle!
end
def sub_manager?(ad_banner)
ad_banner.authed_users(:edit).include?(current_user)
end
def show_ad_banner_permission_link(ad_banner)
type = 'edit'
oa = ad_banner.get_object_auth_by_title(type)
if oa.nil?
ad_banner.object_auths.new(title: type ).save
oa = ad_banner.get_object_auth_by_title(type)
end
# link_to t(:category_auth), edit_admin_object_auth_path(oa)
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa),:class => "btn btn-warning"
end
end
+41
View File
@@ -1,4 +1,45 @@
module Admin::ItemsHelper
def render_node_and_children(node)
ret = ''
if node
case node.class.to_s
when 'Page'
dest = admin_page_path(node)
when 'Link'
dest = admin_link_path(node)
no_nested = 'no-nest'
end
ret << "<li id='#{node.id}' class='#{no_nested}'>"
ret << "<div class='with_action'><i class='icons-plus-3'></i>"
ret << (link_to node.title, dest, :class => 'js_history')
ret << "<div class='quick-edit hide'>"
ret << (link_to t(:edit), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), :class => 'js_history') if node.class.to_s.eql?('Page')
ret << (link_to t('new.page'), new_admin_page_path(:parent_id => node.id), :class => 'new_page js_history') if node.class.to_s.eql?('Page')
ret << (link_to t('new.link'), new_admin_link_path(:parent_id => node.id), :class => 'new_link js_history') if node.class.to_s.eql?('Page')
ret << (link_to t(:delete_), eval("delete_admin_#{node.class.to_s.downcase}_path(node, :authenticity_token => form_authenticity_token)"), :confirm => t('sure?'), :class => 'delete js_history')
ret << "</div>"
ret << "</div>"
ret << render_children(node)
ret << "</li>"
end
ret.html_safe
end
def render_children(parent)
children = parent.children
if !parent.children.entries.blank?
ret = ''
ret << "<ol class='#{'sortable' if parent.parent.nil?}'>"
children.each do |child|
ret << render_node_and_children(child)
end
ret << '</ol>'
ret
else
''
end
end
def get_item_module_infos(item)
if module_app = item.module_app
+1 -1
View File
@@ -180,7 +180,7 @@ module ApplicationHelper
page_title = page.page_title ? page.page_title : page.title
if page.root? && @site.title
res << @site.title
elsif @site.title && !@site.title_always_on
elsif @site.title && @site.title_always_on
res << @site.title + ' - ' + page_title
else
res << page_title
+14 -22
View File
@@ -24,16 +24,13 @@ module OrbitBackendHelper
def show_delete_link(object)
if !current_user.nil?
if object.class.fields.include?('create_user_id')
by_object = (object.create_user_id == current_user.id )
by_user = (is_manager? or is_admin?)
by_object or by_user
else
true
end
by_object = (object.create_user_id == current_user.id )
by_user = (is_manager? or is_admin?)
by_object or by_user
else
false
end
end
# def show_bulletin_title_at_index (bulletin)
@@ -58,7 +55,7 @@ module OrbitBackendHelper
def is_sort_active?(field)
res = t(field[:translation])
if params[:sort] && params[:sort].eql?(field[:sort])
if params[:sort].eql?(field[:sort])
res << " " + content_tag(:b, nil, class: (params[:direction].eql?('asc') ? "icons-arrow-up-3" : "icons-arrow-down-4 "))
end
res.html_safe
@@ -111,17 +108,12 @@ module OrbitBackendHelper
res << status.join(' ')
when 'tags'
sorted_objects = get_sorted_objects(object.tags, 'name') rescue ''
when 'standalone'
res << (field[:need_value] ? eval(field[:display_option]) : field[:display_option])
when 'image'
image = (field[:version] ? object.send(field[:db_field]).send(field[:version]) : object.send(field[:db_field]))
res << image_tag(image)
else
sorted_values = object.send(field[:db_field])
sorted_values = sorted_values.sort if sorted_values.is_a?(Array)
end
res << display_value_from_object(object, sorted_values, field[:display_option]).to_s if sorted_values
res << display_value_from_objects(sorted_objects, field[:model_field], field[:display_option]).to_s if sorted_objects
res << display_value_from_object(object, sorted_values, field[:display_option]) if sorted_values
res << display_value_from_objects(sorted_objects, field[:model_field], field[:display_option]) if sorted_objects
if field[:quick_edit]
res << (content_tag :div, class: "quick-edit" do
content_tag :ul, class: "nav nav-pills" do
@@ -139,7 +131,7 @@ module OrbitBackendHelper
concat (content_tag :thead do
(content_tag :tr, class: "sort-header" do
@fields.each do |field|
concat (content_tag :th, "data-hide" => field[:hide], class: "#{field[:header_class]} #{'active' if (params[:sort] && params[:sort].eql?(field[:sort]))}" do
concat (content_tag :th, "data-hide" => field[:hide], class: "#{field[:header_class]} #{'active' if params[:sort].eql?(field[:sort])}" do
if field[:sort]
link_to is_sort_active?(field), url_for({:filter => @filter}.merge(sortable_options(field[:sort]).merge(:sort_options => field[:db_field])))
else
@@ -184,6 +176,8 @@ module OrbitBackendHelper
display_date(value)
when 'Time'
display_time(value)
when /Uploader/
image_tag(value.url)
else
value
end
@@ -205,7 +199,7 @@ module OrbitBackendHelper
objects.join(' ')
else
objects = Array(objects).map do |object|
display_value(object.send(field)) rescue ''
display_value(object.send(field))
end
objects.join(', ')
end
@@ -247,8 +241,6 @@ module OrbitBackendHelper
args[:translation] ||= 'tags'
args[:display_option] ||= "content_tag(:span, object.name, class: 'label label-warning')"
@fields << args
elsif !args.blank? && args[:type].eql?('standalone')
@fields << args
end
end
@@ -275,7 +267,7 @@ module OrbitBackendHelper
link = (is_manager? || is_sub_manager? rescue nil) && args.has_key?(:link) ? true : false
if paginate || link
@index_footer = content_tag :div, class: "bottomnav clearfix" do
concat content_tag :div, link_to(content_tag(:i, nil, :class => 'icon-plus') + ' ' + t(:add), args[:link].blank? ? '#' : send(args[:link]), :class => (args[:link_class] || 'btn btn-primary'), data: args[:link_data]), class: "action pull-right" if link
concat content_tag :div, link_to(content_tag(:i, nil, :class => 'icon-plus') + ' ' + t(:add), send(args[:link]), :class => 'btn btn-primary' ), class: "action pull-right" if link
concat content_tag :div, paginate(@objects, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]}), class: "pagination pagination-centered" if paginate
end
end
@@ -293,7 +285,7 @@ module OrbitBackendHelper
end
when 'edit'
if authorization && approvable
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}')"), class: quick[:class], data: eval("#{quick[:data]}"))
content_tag :li, link_to(t(quick[:translation] || :edit), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class])
end
when 'delete'
if show_delete_link(object)
@@ -331,7 +323,7 @@ module OrbitBackendHelper
if object.is_a?(klass.constantize)
autorized ||= object.user_can_sub_manage?(current_user)
else
autorized ||= object.send(klass.underscore).user_can_sub_manage?(current_user)
autorized ||= object.category.user_can_sub_manage?(current_user)
end
autorized
end
+55 -15
View File
@@ -2,30 +2,70 @@ class AdBanner
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include OrbitCoreLib::ObjectAuthable
include OrbitTag::Taggable
include OrbitModel::Authorizable
field :ad_fx #TODO Design should explain
field :height, type: Integer
field :speed, type: Integer
field :title
field :timeout, type: Integer
field :width, type: Integer
has_many :ad_images , dependent: :delete
field :transition_msec,type: Integer
field :ad_fx #TODO Design should explain
field :best_size,:default => ''
before_save :save_or_destroy
validates_uniqueness_of :title
validates :title, :length => { :minimum => 2 }
validates :height, :speed, :timeout, :width, :presence => true
validates :title , :length => { :minimum => 2 }
has_many :ad_images , dependent: :delete
FX_TYPES = %w(fade fadeout flipHorz flipVert scrollHorz scrollVert tileSlide tileBlind)
FX_TYPES = ["blindX","blindY","blindZ","cover","curtainX","curtainY","fade","fadeZoom","growX","growY","scrollUp","scrollDown","scrollLeft","scrollRight","scrollHorz","scrollVert","shuffle","slideX","slideY","toss","turnUp","turnDown","turnLeft","turnRight","uncover","wipe","zoom"]
attr_writer :transition_sec
def size
"#{self.width} x #{self.height}"
AfterObjectAuthUrl = '/panel/page_content/back_end/page_contexts'
APP_NAME = 'ad_banners'
ObjectAuthTitlesOptions = %W{edit}
def pp_object
title
end
def timeout_millisecond
self.timeout*1000 rescue 0
def transition_sec
self.transition_msec/1000 rescue nil
end
def transition_sec=(sec)
self.transition_msec = sec.to_i*1000
end
def preview_clone
preview_banner = self.clone
preview_banner.ad_images = self.ad_images
preview_banner
end
# def new_ad_images(*attrs)
# debugger
# a=1
# attrs[0].each do |attr| #Loop by JSs,Themes,Imgs
# unless attr[:file].nil?
# self.ad_images << AdImage.new(attr)
# end
# end
# end
# def existing_ad_images=(*attrs)
# attrs[0].each do |attr| #Loop by JSs,Themes,Imgs
# ad_image = self.ad_images.find attr[0]
# ad_image.update_attributes(attr[1])
# end
# end
def save_or_destroy
self.ad_images.each do |ad_image|
if ad_image.to_save?
ad_image.save
end
if ad_image.to_destroy?
ad_image.destroy
end
end
end
end
+31 -7
View File
@@ -1,29 +1,53 @@
class AdImage
include Mongoid::Document
include Mongoid::Timestamps
include OrbitModel::TimeFrame
include OrbitTag::Taggable
mount_uploader :file, ImageUploader
field :title, localize: true
field :context, localize: true
field :weight, type: Integer, default: 1
field :context, localize: true
field :to_save, :type => Boolean
field :to_destroy, :type => Boolean
field :direct_to_after_click,type: Boolean
field :weight ,type: Integer ,default: 1
field :out_link #the link itself
field :link_open #how will the link be opened
LINK_OPEN_TYPES = ["local", "new_window"]
LINK_OPEN_TYPES = ["new_window","local"]
field :post_date,type: Date
field :unpost_date,type: Date
belongs_to :ad_banner
before_validation :add_http
validates :file, :presence => true
validates :out_link, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i, :allow_blank => true
validates :title, :at_least_one => true
def display?
if (self.post_date <= Date.today && (self.unpost_date.nil? || self.unpost_date>= Date.today) rescue false)
return true
end
return false
end
def get_delay_time
time = ''
if self.time_to_next.nil?
time = '1000'
else
time = (self.time_to_next.to_i * 1000).to_s
end
time
end
protected
def add_http
unless self.out_link.blank? || self.out_link[/^http:\/\//] || self.out_link[/^https:\/\//]
unless self.out_link[/^http:\/\//] || self.out_link[/^https:\/\//] || self.out_link.blank?
self.out_link = 'http://' + self.out_link
end
end
+1
View File
@@ -1,3 +1,4 @@
class AuthManager < Authorization
# belongs_to :manager_authorizable, polymorphic: true
has_and_belongs_to_many :authorized_users, class_name: 'User', inverse_of: 'managing_apps'
end
+16 -3
View File
@@ -7,7 +7,6 @@ class ModuleApp
field :auth_approval_users, type: Array, default: nil
field :auth_manager_users, type: Array, default: nil
field :auth_sub_manager_users, type: Array, default: nil
field :has_category, type: Boolean, default: false
field :key
field :title
field :sidebar_order,type: Integer,default: 0
@@ -190,8 +189,7 @@ class ModuleApp
end
def update_auth_manager_users
users = self.auth_manager_authorized_users
self.update_attribute(:auth_manager_users, users.map{|user| user.id}) if users
self.update_attribute(:auth_manager_users, self.auth_manager_authorized_users.map{|user| user.id})
end
def update_auth_sub_manager_users
@@ -209,6 +207,21 @@ class ModuleApp
managers.include?(user)
end
def add_managers(users)
users = Array(users)
if auth_manager = self.auth_manager
auth_manager.update_attribute(:authorized_users, (auth_manager.authorized_users + users).uniq)
else
self.create_auth_manager(authorized_users: users)
end
end
def remove_managers(users)
users = Array(users)
users = users.delete_if{|user| user == current_user || is_admin?}
self.auth_manager.update_attribute(:authorized_users, auth_manager.authorized_users - users)
end
def is_manager?(user)
if user && !auth_manager_users.blank?
auth_manager_users.include?(user.id)
+2 -2
View File
@@ -30,8 +30,8 @@ class ModuleTag
if self.new_record?
self.build_tag(name_translations: self.name_translations, is_default: self.is_default)
else
self.tag.attributes = {:name_translations => self.name_translations}
self.tag.attributes = {:is_default => self.is_default}
self.tag.name_translations = self.name_translations
self.tag.is_default = self.is_default
end
end
+1 -18
View File
@@ -7,7 +7,6 @@ class Site
field :in_use_locales, :type => Array
field :valid_locales, :type => Array
field :enable_locales, :type => Array
field :roaming_id
field :private_key, :type => Binary
@@ -18,11 +17,11 @@ class Site
field :desktop_closed, :type => Boolean, :default => false
field :sitemap_menu_in_header, :type => Boolean, :default => false
field :enable_terms_of_use, :type => Boolean, :default => false
field :enable_language_detection, :type => Boolean, :default => false
field :title_always_on, :type => Boolean, :default => false
field :dashbroad_allow_visitor, :type => Boolean, :default => false
field :mail_settings, :type => Hash
field :enabled_for, :type => Array, :default => nil
field :disk_space, :type => String
field :system_package_info, :type => Hash,:default=>{}
@@ -31,7 +30,6 @@ class Site
field :department
mount_uploader :default_image, ImageUploader
mount_uploader :favicon, ImageUploader
field :search,:type => Hash
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']
@@ -46,21 +44,6 @@ class Site
belongs_to :design
has_many :site_metas, :autosave => true, :dependent => :destroy
validate :in_use_locales, :minimum_enabled_locales
def minimum_enabled_locales
size = self.in_use_locales.length
if size < 1
errors.add(:size, "Needs at least one language in use")
end
end
def maximum_enabled_locales
size = self.in_use_locales.length
if size >= 2
errors.add(:size, "Max 2 ")
end
end
def generate_keys
private_key = OpenSSL::PKey::RSA.generate(2048)
+5
View File
@@ -1,3 +1,8 @@
# class Tag < ProtoTag
# belongs_to :module_app
# end
class Tag
include Mongoid::Document
include Mongoid::Timestamps
+7 -8
View File
@@ -1,12 +1,15 @@
# encoding: utf-8
require 'carrierwave/processing/mime_types'
class AssetUploader < CarrierWave::Uploader::Base
include CarrierWave::MimeTypes
require 'mime/types'
process :set_content_type
def set_content_type(*args)
content_type = file.content_type == ('binary/octet-stream' || 'application/octet-stream') || file.content_type.blank? ? MIME::Types.type_for(original_filename).first.to_s : file.content_type
self.file.instance_variable_set(:@content_type, content_type)
end
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
@@ -49,8 +52,4 @@ class AssetUploader < CarrierWave::Uploader::Base
# model.filename
# end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
end
+14 -12
View File
@@ -1,15 +1,11 @@
# encoding: utf-8
require 'carrierwave/processing/mime_types'
class AvatarUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
include CarrierWave::MiniMagick
include CarrierWave::MimeTypes
process :set_content_type
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
@@ -47,17 +43,23 @@ class AvatarUploader < CarrierWave::Uploader::Base
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
%w(jpg jpeg gif png)
end
# def extension_white_list
# %w(jpg jpeg gif png)
# end
# Override the filename of the uploaded files:
# def filename
# "something.jpg" if original_filename
# end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
# def manipulate!
# raise current_path.inspect
# image = ::MiniMagick::Image.open(current_path)
# image = yield(image)
# image.write(current_path)
# ::MiniMagick::Image.open(current_path)
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
# end
end
@@ -33,8 +33,4 @@ class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
def extension_white_list
Ckeditor.attachment_file_types
end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
end
@@ -44,8 +44,4 @@ class CkeditorPictureUploader < CarrierWave::Uploader::Base
def extension_white_list
Ckeditor.image_file_types
end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
end
+7 -8
View File
@@ -1,12 +1,15 @@
# encoding: utf-8
require 'carrierwave/processing/mime_types'
class FileAssetUploader < CarrierWave::Uploader::Base
include CarrierWave::MimeTypes
require 'mime/types'
process :set_content_type
def set_content_type(*args)
content_type = file.content_type == ('binary/octet-stream' || 'application/octet-stream') || file.content_type.blank? ? MIME::Types.type_for(original_filename).first.to_s : file.content_type
self.file.instance_variable_set(:@content_type, content_type)
end
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
@@ -49,8 +52,4 @@ class FileAssetUploader < CarrierWave::Uploader::Base
# model.filename.force_encoding("UTF-8")
# end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
end
+23 -4
View File
@@ -1,15 +1,22 @@
# encoding: utf-8
require 'carrierwave/processing/mime_types'
class ImageUploader < CarrierWave::Uploader::Base
require 'mime/types'
require 'carrierwave/processing/mini_magick'
include Sprockets::Helpers::RailsHelper
process :set_content_type
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
include CarrierWave::MiniMagick
include CarrierWave::MimeTypes
process :set_content_type
def set_content_type(*args)
content_type = file.content_type == ('binary/octet-stream' || 'application/octet-stream') || file.content_type.blank? ? MIME::Types.type_for(original_filename).first.to_s : file.content_type
self.file.instance_variable_set(:@content_type, content_type)
end
# Choose what kind of storage to use for this uploader:
# storage :file
@@ -56,8 +63,20 @@ class ImageUploader < CarrierWave::Uploader::Base
# "something.jpg" if original_filename
# end
def cache_dir
def cache_dir
"#{Rails.root}/tmp/uploads"
end
def manipulate!
# cache_stored_file! if !cached?
#raise File.extname(current_path.to_s).to_s
# image = ::MiniMagick::Image.open(current_path)
# image = yield(image)
# image.write(current_path)
# ::MiniMagick::Image.open(current_path)
# rescue
# nil
end
end
+11 -10
View File
@@ -1,14 +1,9 @@
require 'carrierwave/processing/mime_types'
class LocationUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
# include CarrierWave::RMagick
# include CarrierWave::ImageScience
include CarrierWave::MiniMagick
include CarrierWave::MimeTypes
process :set_content_type
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
@@ -51,10 +46,16 @@ class LocationUploader < CarrierWave::Uploader::Base
# def filename
# "something.jpg" if original_filename
# end
def cache_dir
"#{Rails.root}/tmp/uploads"
end
# def manipulate!
# raise current_path.inspect
# image = ::MiniMagick::Image.open(current_path)
# image = yield(image)
# image.write(current_path)
# ::MiniMagick::Image.open(current_path)
# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
# end
end
@@ -0,0 +1,39 @@
<div class="tab-pane fade <%= "active in" if ad_banner_tab==@active%>" id=<%= ad_banner_tab.title.dehumanize %>>
<% if at_least_module_manager || sub_manager?(ad_banner_tab)%>
<%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%>
<div class="adbanner-setup well">
<!--<p><%#= t("ad.banner_best_size") %>:</p>-->
<%= f.label :ad_fx, t('ad.ab_fx') %>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<%= f.label :transition_sec, t('ad.transition_sec') %>
<%= f.text_field :transition_sec,:placeholder=>t('ad.sec_place_holder'),:class=> "span3" %> <%= t("ad.trans_unit_sec") %>
<%if at_least_module_manager%>
<%= f.label :best_size, t('ad.best_size') %>
<%= f.text_field :best_size %> Ex: 500px x 300px
<% end -%>
<br>
<%= f.submit t("ad.update_banner"), :class => 'btn' %>
<%= f.submit t("cancel"),:type=>'reset', :class => 'btn' %>
</div>
<% end -%>
<% end -%>
<h3><%= t("ad.picture_list")%></h3>
<div class="adbanner-list">
<%if (at_least_module_manager || ad_banner_tab.cur_user_is_sub_manager_of(:edit) )%>
<%= content_tag :div ,:class=>'adbanner-action' do%>
<%= link_to t("ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%>
<%= link_to t(:preview), admin_realtime_preview_ad_banner_path(ad_banner_tab.id) , :class=>'preview_trigger btn btn-success'%>
<% end -%>
<% end -%>
<ul class="clear">
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
</ul>
<% if at_least_module_manager %>
<%= show_ad_banner_permission_link ad_banner_tab%>
<%= link_to t(:delete_),admin_ad_banner_path(ad_banner_tab),:class => 'btn',:method => :delete,:confirm => t('sure?') %>
<% end -%>
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
</div>
<%#= render :partial => 'preview_block',:locals=> {:ad_banner =>ad_banner_tab} %>
</div>
@@ -0,0 +1,13 @@
<li class="span3">
<%= image_tag ad_image.file rescue nil%>
<p>
<%= ad_image.display? ? "[#{t('ad.showing')}]" : "[#{t('ad.not_showing')}]" %>
<%= "#{ad_image.post_date} ~ #{ad_image.unpost_date}" %>
</p>
<%if at_least_module_manager || sub_manager?(ad_image.ad_banner) %>
<p>
<%= link_to t('edit'),edit_admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn btn-primary' %>
<%= link_to t(:delete_),admin_ad_banner_ad_image_path(ad_banner,ad_image),:class => 'btn',:method => :delete,:confirm => t('sure?') %>
</p>
<% end -%>
</li>
+25 -9
View File
@@ -1,9 +1,25 @@
<%= form_for @ad_banner, url: admin_ad_banner_path(@ad_banner), remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
<div class="content">
<%= form_for(:ad_banner, :url => admin_ad_banner_path(:ad_banner), :remote => true) do |f| %>
<fieldset>
<legend>Ad Banner</legend>
<label>Banner Name</label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block">Banner Name only english</span>
<label for="timeout">Ste</label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block">Please enter the number of seconds</span>
<label>Best Size</label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block">Best Size EX:120x30 </span>
<label>Effect</label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block">Effect</span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
</div>
-28
View File
@@ -1,28 +0,0 @@
<%= flash_messages %>
<%= f.error_messages %>
<%= f.label :title, t('ad_banner.banner_name') %>
<%= f.text_field :title, class: 'input-large', placeholder: t('ad_banner.banner_name'), id: 'name' %>
<span class="help-block"><%= t('ad_banner.name_only_english') %></span>
<%= f.label :timeout, t('ad_banner.transition_interval') %>
<%= f.number_field :timeout, in: 0..60, step: 1, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'timeout' %>
<span class="help-block"><%= t('ad_banner.number_seconds') %></span>
<%= f.label :speed, t('ad_banner.transition_speed') %>
<%= f.number_field :speed, in: 0..1000, step: 100, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'speed' %>
<span class="help-block"><%= t('ad_banner.number_milliseconds') %></span>
<%= f.label :size, t('ad_banner.size') %>
<span class="banner_set">W:</span>
<%= f.number_field :width, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'width' %>
<span class="banner_set">H:</span>
<%= f.number_field :height, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'height' %>
<%= f.label :ad_fx, t('ad_banner.effect') %>
<%= f.select :ad_fx, AdBanner::FX_TYPES, {}, {class: 'ad_banner_ad_fx', id: 'ad_fx'} %>
<p class="suckIE hide"><i class="icons-warning"></i> <%= t('ad_banner.no_ie_10_effect_support') %></p>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", width: 200, height: 80 %>
<%= image_tag "slideshow_preview_B.png", width: 200, height: 80 %>
</div>
+37 -71
View File
@@ -1,75 +1,41 @@
<% set_default_index do
objects @ad_banners
quick_edit_link type: 'edit',
class: 'open-slide',
data: "{form: {"
.concat("width: object.width")
.concat(", height: object.height")
.concat(", ad_fx: object.ad_fx")
.concat(", name: object.title")
.concat(", timeout: object.timeout")
.concat(", speed: object.speed")
.concat("}.to_json")
.concat(", title: t('ad_banner.edit_banner')")
.concat(", id: object.id.to_s")
.concat(", fx: object.ad_fx")
.concat("}")
<table class="table main-list">
<thead>
<tr>
<th class="span1"><%= t('ad_banner.title') %></th>
<th class="span1"><%= t('ad_banner.transition_msec') %></th>
<th class="span1"><%= t('ad_banner.ad_fx') %></th>
</tr>
</thead>
<tbody id="tbody_locations" class="sort-holder">
<% @ad_banners.each do |ad_banner| %>
<tr class="with_action">
<td><%= ad_banner.title %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner)%></li>
<li><%= link_to 'Destroy', admin_ad_banner_path(ad_banner), method: :delete , :confirm => t(:sure?) %></li>
# '{"#first":{"equal":"Yes"}}'
quick_edit_link type: 'detail'
quick_edit_link type: 'delete',
link: 'admin_ad_banner_path'
# can have: title, warning, cancel and submit values
field db_field: 'title',
translation: 'ad_banner.banner_name',
sort: 'title',
quick_edit: true,
header_class: 'span4',
sort: 'title'
field db_field: 'ad_fx',
translation: 'ad_banner.effect',
hide: 'phone',
sort: 'effect'
field db_field: 'timeout',
translation: 'ad_banner.transition_interval',
hide: 'phone',
sort: 'timeout'
field db_field: 'speed',
translation: 'ad_banner.transition_speed',
hide: 'phone',
sort: 'speed'
field db_field: 'size',
translation: 'ad_banner.size',
hide: 'phone',
sort: 'size'
field type: 'standalone',
translation: 'preview',
display_option: "link_to(t(:preview), '#', data: {w: object.width, h: object.height, fx: object.ad_fx, time: object.timeout_millisecond, speed: object.speed, name: object.title}, class: 'btn btn-success open-modal')",
need_value: true,
hide: 'phone'
footer link: '',
link_class: 'btn btn-primary open-slide',
link_data: {title: t('ad_banner.new_banner'), id: 'new', fx: 'fade'}
end %>
<% end %>
</ul>
</div>
</td>
<td><%= ad_banner.transition_msec %></td>
<td><%= ad_banner.ad_fx%></td>
</tr>
<% end %>
</tbody>
</table>
<%if is_manager? %>
<!-- footer -->
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), "#add-banner", :class => "btn btn-primary open-slide"%>
</div>
</div>
<%= render 'admin/default_index/index' %>
<div id="add-banner" class="nano" style="display:none">
<%= render 'new' %>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "cycle2" %>
<%= javascript_include_tag "lib/ad_banner/banner_preview" %>
<% end %>
<div id="preview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="ModalLabel"><%= t(:preview) %></h3>
</div>
<div class="modal-body">
<div class="preview">
<%= image_tag "slideshow_preview_A.png", class: 'hide' %>
<%= image_tag "slideshow_preview_B.png", class: 'hide' %>
</div>
</div>
<div class="modal-footer">
</div>
</div>
@@ -0,0 +1,46 @@
<div id="new-a-banner" class="modal fade <%= 'active' if @active.nil? %>">
<%= form_for(:ad_banner,:remote => true, :url => admin_ad_banners_path) do |f| %>
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3><%= t('new.banner') %></h3>
</div>
<div class="modal-body form-horizontal">
<div class="control-group">
<%= f.label :title, t(:title),:class => "control-label" %>
<div class="controls">
<%= f.text_field :title %>
</div>
</div>
<div class="control-group">
<%= f.label :transition_sec, t('ad.transition_sec'),:class => "control-label" %>
<div class="controls">
<%= f.text_field :transition_sec %> <%= t("ad.trans_unit_sec") %>
</div>
</div>
<div class="control-group">
<%= f.label :best_size, t('ad.best_size'),:class => "control-label" %>
<div class="controls">
<%= f.text_field :best_size %> <%= t('ad.best_size_example') %>
</div>
</div>
<div class="control-group">
<%= f.label :ad_fx, t('ad.ab_fx') %>
<div class="controls">
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
</div>
</div>
</div>
<div class="modal-footer">
<span id="ad_banner-modal-info"></span>
<%= f.submit t('submit'), :class=>'btn btn-primary',:remote=>true %>
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
</div>
<% end %>
</div>
@@ -0,0 +1,36 @@
<% if ad_banner -%>
<div class="modal hide fade in banner-preview" id="slideshow-<%=ad_banner.title.dehumanize%>">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3><%= t(:preview) %></h3>
</div>
<div class="modal-body">
<p class="ad_banner_slideshow">
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
<%= image_tag ad_image.file,:alt => (ad_image.title || " "),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || " ")) %>
<% end -%>
</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal"><%= t(:close) %></a>
</div>
<div>
<script type="text/javascript" src="/static/kernel.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#slideshow-<%=ad_banner.title.dehumanize%>").on("show", function () {
$("#slideshow-<%=ad_banner.title.dehumanize%>").find(".ad_banner_slideshow").cycle({delay: -1000, fx: "<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>", timeoutFn: getTimeout });
});
$(".modal").on("hidden", function () {
$("#show_preview").remove();
});
});
</script>
</div>
</div>
<% end -%>
+25 -9
View File
@@ -1,9 +1,25 @@
<%= form_for @ad_banner, url: admin_ad_banners_path, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
<div class="content">
<%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
<fieldset>
<legend>Ad Banner</legend>
<label>Banner Name</label>
<%= f.text_field :title, :class=>"input-large", :placeholder=>"Banner Name" %>
<span class="help-block">Banner Name only english</span>
<label for="timeout">Ste</label>
<%= f.text_field :transition_sec, :class => 'input-large', :placeholder => 'Time' %>
<span class="help-block">Please enter the number of seconds</span>
<label>Best Size</label>
<%= f.text_field :best_size, :class=>"input-large", :placeholder=>"Banner Size" %>
<span class="help-block">Best Size EX:120x30 </span>
<label>Effect</label>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<div class="preview">
<%= image_tag "slideshow_preview_A.png", :width=>220 %>
<%= image_tag "slideshow_preview_B.png", :width=>220 %>
</div>
<span class="help-block">Effect</span>
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:create_), class: 'btn btn-primary btn-small' %>
</fieldset>
<% end %>
</div>
@@ -0,0 +1,7 @@
<%= f.fields_for field_name, new_add_banner_file do |f| %>
<p class="new_file">
<%= f.file_field :file %>
<%#= render :partial => "ad_image_form", :locals => { :f => f } %>
<%= button_tag '+', :class => "multi_files"%>
</p>
<% end %>
@@ -0,0 +1,29 @@
<% if ad_banner -%>
<%= link_to t(:preview),"#slideshow-#{ad_banner.title.dehumanize}",:class=>"btn btn-primary btn-large",:data=>{:toggle=>'modal'} %>
<div class="modal hide fade in banner-preview" id='slideshow-<%=ad_banner.title.dehumanize%>'>
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3><%= t(:preview) %></h3>
</div>
<div class="modal-body">
<p class="ad_banner_slideshow">
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
<%= image_tag ad_image.file,:alt => (ad_image.title || ' '),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %>
<% end -%>
</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
</div>
</div>
<% end -%>
<script type='text/javascript' src='/static/kernel.js'></script>
<script type='text/javascript'>
$('#slideshow-<%=ad_banner.title.dehumanize%>').on('show', function () {
$('#slideshow-<%=ad_banner.title.dehumanize%>').find(".ad_banner_slideshow").cycle({delay: -1000, fx: '<%= ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx %>', timeoutFn: getTimeout });
});
</script>
@@ -0,0 +1 @@
$("#ad_banner-modal-info").append("<%= @ad_banner.errors.full_messages.join(',')%>");
+1 -1
View File
@@ -1 +1 @@
$('.view-page .content').html("<%= j render 'edit' %>");
$('#view-page .content').html("<%= j render 'edit' %>");
+7 -25
View File
@@ -1,27 +1,9 @@
<div id="banner_index">
<%= render 'index' %>
</div>
<% content_for :right_nav do %>
<div class="searchClear pull-right">
<input id="filter-input" class="search-query input-medium" type="text" placeholder="<%= t('search.tags') %>" value="">
</div>
<% end %>
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
</a>
<span></span>
</div>
<div class="view-page">
<div class="nano">
<div class="content">
<%= form_for :ad_banner, url: nil, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
<div id="tags_index">
<%= render 'index' %>
</div>
+2 -3
View File
@@ -1,4 +1,3 @@
$("#banner_index").html("<%= j render 'index' %>")
$("#categories_index").html("<%= j render 'index' %>")
$.pageslide.close();
openSlide();
preview();
openSlide();
+1 -1
View File
@@ -1 +1 @@
$('.view-page .content').html("<%= j render 'new' %>");
$('#view-page .content').html("<%= j render 'new' %>");
@@ -0,0 +1,18 @@
$('<%= escape_javascript(content_tag(:li,link_to(@ad_banner.title,"##{@ad_banner.title}",:data=>{:toggle=>"tab"}))) %>').insertBefore("#new_ad_banner_tab_but");
$('<%= escape_javascript(render(:partial => "ad_banner_tab",:locals => {:ad_banner_tab => @ad_banner})) %>').insertAfter($("#ad_banner-tab-content").children(".tab-pane").last());
$('.modal').modal('hide');
$("#ad_banner-modal-info").empty();
$("#new-a-banner form").each(function(){this.reset();});
$('#new-a-banner').unbind();
$('#post-body-content').find(".nav.nav-tabs").children('li.active').removeClass("active");
$("#ad_banner-tab-content").children(".tab-pane").removeClass("active");
$('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active");
$("#ad_banner-tab-content").children(".tab-pane").last().addClass("active");
<% if params[:action] && params[:action] =='create'%>
var trigger = $("#ad_banner-tab-content").children(".tab-pane").last().find(".preview_trigger");
new_url = trigger.attr("href").replace(/\/admin\/ad_banners\/.*\/preview/gi,"/admin/ad_banners/<%= @ad_banner.id %>/preview");
trigger.attr("href",new_url);
<% end %>
@@ -0,0 +1,2 @@
$('#show_preview').html("<%= escape_javascript(render(:partial => 'modal_preview',:locals => {:ad_banner => @ad_banner})) %>");
var start_modal_with_id = "slideshow-<%=@ad_banner.title.dehumanize%>"
+167 -127
View File
@@ -1,75 +1,104 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/module-area" %>
<%= javascript_include_tag "lib/modal-preview" %>
<%= javascript_include_tag "lib/file-type" %>
<% end %>
<%= f.error_messages %>
<!-- Forms -->
<form class="form-horizontal main-forms">
<fieldset>
<!-- Input Area -->
<div class="input-area">
<!-- Input Area -->
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
<li>
<a href="#type" data-toggle="tab"><%= t('ad_banner.type') %></a>
</li>
<li>
<a href="#frequency" data-toggle="tab"><%= t(:frequency) %></a>
</li>
<li>
<a href="#link" data-toggle="tab"><%= t(:link) %></a>
</li>
<li>
<a href="#imageupload" data-toggle="tab"><%= t(:image) %></a>
</li>
</ul>
<!-- Module Tabs -->
<div class="nav-name"><strong>Module</strong></div>
<ul class="nav nav-pills module-nav">
<li class="active">
<a href="#basic" data-toggle="tab">Basic</a>
</li>
<li>
<a href="#status" data-toggle="tab">Status</a>
</li>
<li>
<a href="#tag" data-toggle="tab">Tags</a>
</li>
<li>
<a href="#type" data-toggle="tab">Type</a>
</li>
<li>
<a href="#frequency" data-toggle="tab">Frequency</a>
</li>
<li>
<a href="#link" data-toggle="tab">Link</a>
</li>
<li>
<a href="#imageupload" data-toggle="tab">Images</a>
</li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<!-- Category -->
<div class="control-group">
<label class="control-label muted"><%= t('ad_banner.banner') %></label>
<div class="controls">
<%= f.select :ad_banner_id, @ad_banners.collect{|t| [ t.title, t.id ]} %>
</div>
</div>
<!-- Category -->
<div class="control-group">
<label class="control-label muted">Banner</label>
<div class="controls">
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title", @ad_image.ad_banner_id) , :class=>"input-medium" %>
</div>
</div>
<!-- Date Time Picker -->
<div class="control-group">
<label class="control-label muted"><%= t(:start_date) %></label>
<div class="controls">
<%= f.datetime_picker :postdate, :no_label => true %>
</div>
</div>
<!-- Date Time Picker -->
<div class="control-group">
<label class="control-label muted"><%= t(:end_date) %></label>
<div class="controls">
<%= f.datetime_picker :deadline, :no_label => true %>
</div>
</div>
<!-- Date Time Picker -->
<div class="control-group">
<label class="control-label muted"><%= t(:start_date) %></label>
<div class="controls">
<%= f.datetime_picker :post_date, :no_label => true %>
</div>
</div>
</div>
<!-- Date Time Picker -->
<div class="control-group">
<label class="control-label muted"><%= t(:end_date) %></label>
<div class="controls">
<%= f.datetime_picker :unpost_date, :no_label => true %>
</div>
</div>
<!-- Tag Module -->
</div>
<!-- Status Module -->
<div class="tab-pane fade" id="status">
<!-- Status -->
<div class="control-group">
<label class="control-label muted">Status</label>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn">
<input type="checkbox" value="1"> Top
</label>
<label class="checkbox inline btn">
<input type="checkbox" value="2"> Hot
</label>
<label class="checkbox inline btn">
<input type="checkbox" value="3"> Hide
</label>
</div>
</div>
</div>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
@@ -87,83 +116,83 @@
</div>
<!-- Type Module -->
<div class="tab-pane fade" id="type">
<!-- Type Module -->
<div class="tab-pane fade" id="type">
<!-- Type -->
<div class="control-group">
<label class="control-label muted"><%= t('ad_banner.type') %></label>
<div class="controls">
<%= f.select :link_open, AdImage::LINK_OPEN_TYPES.map{|a| [t("ad_banner.#{a}"), a]} %>
</div>
</div>
<!-- Type -->
<div class="control-group">
<label class="control-label muted">Type</label>
<div class="controls">
<%= f.select :link_open ,AdImage::LINK_OPEN_TYPES%>
</div>
</div>
</div>
</div>
<!-- Frequency Module -->
<div class="tab-pane fade" id="frequency">
<!-- Frequency Module -->
<div class="tab-pane fade" id="frequency">
<!-- Frequency -->
<div class="control-group">
<label class="control-label muted"><%= t(:frequency) %></label>
<div class="controls">
<%= f.number_field :weight, placeholder: t(:frequency), in: 1..99, maxlength: 2, onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;" %>
<span class="help-block"><%= t('ad_banner.enter_number') %></span>
</div>
</div>
<!-- Frequency -->
<div class="control-group">
<label class="control-label muted">Frequency</label>
<div class="controls">
<%= f.text_field :weight ,:class=> 'span3',:placeholder=> t('ad.chinese_1') %>
<span class="help-block">Please enter the number</span>
</div>
</div>
</div>
</div>
<!-- Link Module -->
<div class="tab-pane fade" id="link">
<!-- Link Module -->
<div class="tab-pane fade" id="link">
<!-- Link -->
<div class="control-group">
<label class="control-label muted"><%= t(:link) %></label>
<div class="controls">
<%= f.text_field :out_link, placeholder: t(:url) %>
<span class="help-block"><%= t('ad_banner.enter_url') %></span>
</div>
</div>
<!-- Link -->
<div class="control-group">
<label class="control-label muted">link</label>
<div class="controls">
<%= f.text_field :out_link ,:class=> 'span3',:placeholder=> "URL" %>
<span class="help-block">Please enter the URL</span>
</div>
</div>
</div>
</div>
<!-- Images Module -->
<div class="tab-pane fade" id="imageupload">
<!-- Images Module -->
<div class="tab-pane fade" id="imageupload">
<!-- Images Upload -->
<div class="control-group">
<label class="control-label muted"><%= t(:image) %></label>
<div class="controls">
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @ad_image.file.file %>" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @ad_image.file.file %>
<%= image_tag @ad_image.file %>
<% else %>
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<span class="fileupload-exists"><%= t(:change) %></span>
<%= f.file_field :file %>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<%= f.check_box :remove_file %><%= t(:remove) %>
</label>
</div>
</div>
</div>
</div>
<!-- Images Upload -->
<div class="control-group">
<label class="control-label muted"><%= t(:image) %></label>
<div class="controls">
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix fileupload-edit" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @ad_image.file %>
<%= image_tag @ad_image.file %>
<% else %>
<%= image_tag "http://www.placehold.it/50x50/EFEFEF/AAAAAA" %>
<%end%>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<span class="fileupload-exists"><%= t(:change) %></span>
<%= f.file_field :file %>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<%= f.check_box :remove_file %><%= t(:remove) %>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
@@ -195,8 +224,8 @@
<label class="control-label muted"><%= t(:content) %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :context_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@ad_image.context_translations[locale] rescue nil) %>
<%= f.fields_for :text_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@ad_image.text_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
@@ -205,13 +234,24 @@
</div>
<% end %>
</div>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</div>
<!-- Form Actions -->
<%= f.hidden_field :id, :value => @ad_image.id %>
<div class="form-actions">
<%= f.submit t("submit"),:class=>"btn btn-primary" %>
<%= f.submit t("cancel"),:class=>"btn ",:type => 'reset' %>
<!-- <button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn">Preview</button>
<button type="button" class="btn">Cancel</button> -->
</div>
</fieldset>
</form>
+8 -5
View File
@@ -1,5 +1,8 @@
<%= form_for @ad_image, url: admin_ad_image_path(@ad_image), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>
<%= flash_messages %>
<%= form_for @ad_image, :url => admin_ad_image_path, :html => { :class => 'form' } do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<% end %>
+47 -56
View File
@@ -1,57 +1,48 @@
<% set_default_index do
objects @ad_images
quick_edit_link type: 'edit',
link: 'edit_admin_ad_image_path'
# quick_edit_link type: 'detail'
quick_edit_link type: 'delete',
link: 'admin_ad_image_path'
# can have: title, warning, cancel and submit values
field type: 'image',
db_field: 'file',
version: 'thumb',
translation: 'preview',
hide: 'phone'
# field type: 'status',
# db_field: @statuses,
# translation: 'status',
# hide: 'phone',
# sort: 'status'
field type: 'associated',
db_field: 'ad_banner',
model_field: 'title',
translation: 'ad_banner.banner',
hide: 'phone',
sort: 'ad_banner'
field db_field: 'title',
translation: 'title',
sort: 'title',
quick_edit: true,
header_class: 'span5',
sort: 'title'
field db_field: 'postdate',
translation: 'start_date',
hide: 'phone',
sort: 'start_date'
field db_field: 'deadline',
translation: 'end_date',
hide: 'phone',
sort: 'end_date'
field db_field: 'out_link',
translation: 'link',
sort: 'link',
display_option: 'link_to value, value'
# filter_field type: 'array',
# values: @statuses,
# translation: 'status'
# filter_field type: 'objects',
# values: @categories,
# translation: 'category',
# object_field: 'title'
# filter_field type: 'objects',
# values: @tags,
# translation: 'tags',
# object_field: 'name'
footer link: 'new_admin_ad_image_path'
end %>
<table class="table main-list">
<thead>
<tr>
<th class="span1"><%= t('ad_image.image') %></th>
<th class="span1"><%= t('ad_image.post_date') %></th>
<th class="span1"><%= t('ad_image.unpost_date') %></th>
<th class="span1"><%= t('ad_image.context') %></th>
<th class="span1"><%= t('ad_image.out_link') %></th>
</tr>
</thead>
<tbody id="tbody_locations" class="sort-holder">
<% @ad_images.each do |ad_image| %>
<tr class="with_action">
<td><%= image_tag ad_image.file.thumb %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), edit_admin_ad_image_path(ad_image)%></li>
<li><%= link_to 'Destroy', admin_ad_image_path(ad_image), method: :delete , :confirm => t(:sure?) %></li>
<%= render 'admin/default_index/index' %>
<% end %>
</ul>
</div>
</td>
<td><%= ad_image.post_date %></td>
<td><%= ad_image.unpost_date %></td>
<td><%= ad_image.context %></td>
<td><%=link_to "#{ad_image.out_link}", ad_image.out_link %></td>
</tr>
<% end %>
</tbody>
</table>
<%if is_manager? %>
<!-- footer -->
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add_new), "#add-banner", :class => "btn btn-primary open-slide"%>
</div>
<div class="pagination pagination-centered">
<%= paginate @ad_images unless @ad_images.blank? %>
</div>
</div>
<div id="add-banner" class="nano" style="display:none">
<%= render 'new' %>
</div>
<% end %>
+7 -5
View File
@@ -1,5 +1,7 @@
<%= form_for @ad_image, url: admin_ad_images_path, html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>
<%= flash_messages %>
<%= form_for @ad_image, :url => admin_create_ad_image_path, :html => { :class => 'form' ,:multipart => true} do |f| %>
<%= render :partial => "form", :locals => { :f => f } %>
<% end %>
@@ -6,8 +6,8 @@
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), '#', class: "open-slide", data: {title: t(:edit_category), id: category.id.to_s, module: @module_app_id.to_s, form: category.title_translations} %></li>
<li><%= link_to show_toggle_archive_btn(category), toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
<li><%= link_to t(:edit), edit_admin_module_app_category_path(@module_app_id, category), class: "open-slide" %></li>
<li><%= link_to show_toggle_archive_btn(category) , toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
<% end %>
<% if is_manager? || is_admin? %>
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
@@ -1,5 +1,6 @@
<%= form_for @category, :url => admin_module_app_category_path(@module_app_id, @category), remote: true do |f| %>
<fieldset>
<legend><%= t(:edit_category) %></legend>
<%= render :partial => 'form', :locals => {:f => f} %>
</fieldset>
<div class="form-actions">
+1 -1
View File
@@ -4,6 +4,6 @@
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name) %>
<% end %>
<% end %>
+1 -1
View File
@@ -13,7 +13,7 @@
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), new_admin_module_app_category_path(@module_app_id), class: "btn btn-primary open-slide" %>
</div>
<div class="pagination pagination-centered">
<%= paginate @categories unless @categories.blank? %>
+1
View File
@@ -1,5 +1,6 @@
<%= form_for @category, :url => admin_module_app_categories_path(@module_app_id), remote: true do |f| %>
<fieldset>
<legend><%= t(:add_category) %></legend>
<%= render :partial => 'form', :locals => {:f => f} %>
</fieldset>
<div class="form-actions">
+1 -1
View File
@@ -1 +1 @@
$('.view-page .content').html("<%= j render 'edit' %>");
$('#view-page .content').html("<%= j render 'edit' %>");
-24
View File
@@ -1,27 +1,3 @@
<div id="categories_index">
<%= render 'index' %>
</div>
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
</a>
<span></span>
</div>
<div class="view-page">
<div class="nano">
<div class="content">
<%= form_for :category, url: nil, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
</div>
+1 -1
View File
@@ -1 +1 @@
$('.view-page .content').html("<%= j render 'new' %>");
$('#view-page .content').html("<%= j render 'new' %>");
Loaded 100 of 190 files, more files were not shown because too many files have changed in this diff. Show more