Add mobile but remove news in it

This commit is contained in:
chris 2012-12-20 03:21:50 +08:00
parent cf91139b84
commit 3a9106c10d
66 changed files with 6943 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,15 @@
// 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 mobile/jquery.cycle.all
//= 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

View File

@ -0,0 +1,350 @@
/*!
* 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);

View File

@ -0,0 +1,34 @@
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();

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,147 @@
(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 );

View File

@ -0,0 +1,242 @@
//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 <20>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');
}
});
};

View File

@ -0,0 +1,373 @@
/*!
* 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) );

View File

@ -0,0 +1,129 @@
<%#= 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:'scrollLeft',
timeout: 6000,
});
$(".newlist").css({
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
})
// var oc_timer;
// clearTimeout(oc_timer);
// oc_timer = setTimeout(function () {
// $('.newlist').swipePlanes();
// }, 1000);
});
$('#news_content').live('pageinit',function(){
$(this).find(".newpic img").muImageResize({width: 320, height: 220});
});
var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 };
$('#map').live('pageinit', function() {
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': "<%= I18n.t('mobile.location_description') %>" }, 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:'scrollLeft',
timeout: 6000,
});
$(".newlist").css({
"width" : $(".newitem").outerWidth()*(Math.floor($globalW/$(".newitem").outerWidth()))+30,
})
$("#map_canvas").css({
'height' : $windowH,
})
// $('.newlist').swipePlanes();
}, 500);
});

View File

@ -0,0 +1,10 @@
/*
*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 mobile/icons
*= require mobile/font-awesome
*/

View File

@ -0,0 +1,158 @@
/**
*
* 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);
}
}

View File

@ -0,0 +1,303 @@
/* 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"; }

View File

@ -0,0 +1,519 @@
/* 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

View File

@ -0,0 +1,374 @@
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: 280px;
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: .83em;
margin-top: .2em;
}
.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;
}
#news_content .content .newpic {
width: 320px;
height: 220px;
margin: 0 auto;
}
#news_content .content .newstitle {
font-size: 1.4em;
padding: 0 10px;
margin: 1em 0;
}
#news_content .content .newsDate {
padding: 0 10px;
font-size: 1em;
color: #8D8D8D;
}
#news_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: 560px;
}
.main-menu ul li {
width: 128px;
}
}
@media(min-width:768px) {
.main-menu ul {
width: 640px;
}
.main-menu ul li {
width: 148px;
}
.content .newitem {
width: 280px;
}
}
@media(min-width:800px) {
.main-menu ul {
width: 640px;
}
.main-menu ul li {
width: 148px;
}
}
@media(min-width:961px) {
.main-menu ul {
width: 640px;
}
.main-menu ul li {
width: 148px;
}
}
@media(min-width: 1024px) {
.main-menu ul {
width: 800px;
}
.main-menu ul li {
width: 188px;
}
.content .newitem {
width: 280px;
}
}
@media(min-width:1280px) {
}

View File

@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base
layout :layout_by_resource layout :layout_by_resource
helper :admin helper :admin
before_filter :set_locale, :set_site before_filter :set_locale, :set_site, :prepare_for_mobile
helper_attr :site_valid_locales helper_attr :site_valid_locales
@ -121,6 +121,7 @@ class ApplicationController < ActionController::Base
respond_to do |format| respond_to do |format|
format.html { render :text => parse_page_content(@item), :layout => 'page_layout' } format.html { render :text => parse_page_content(@item), :layout => 'page_layout' }
format.rss { render_main_rss } format.rss { render_main_rss }
format.mobile { redirect_to mobile_path }
end end
else else
render :text => '404 Not Found' render :text => '404 Not Found'
@ -228,4 +229,20 @@ class ApplicationController < ActionController::Base
redirect_to ret redirect_to ret
end end
private
def mobile_device?
if session[:mobile_param]
session[:mobile_param] == "1"
else
request.user_agent =~ /iPhone|iPod|Android/
end
end
def prepare_for_mobile
session[:mobile_param] = params[:mobile] if params[:mobile]
request.format = :mobile if mobile_device?
end
end end

View File

@ -0,0 +1,52 @@
class MobileController < ApplicationController
layout 'mobile'
def index
date_now = Time.now
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
@ad_banner = AdBanner.where(title: "Banner")[0]
end
def announcement
@page_title = t('mobile.bulletin')
date_now = Time.now
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
end
def announcement_content
@bulletin = Bulletin.find(params[:id]) rescue nil
@page_title = @bulletin.title
end
def dialog_contact
@no_menu = @no_footer = true
@page_title = t('mobile.contact')
end
def dialog_copyright
@no_menu = @no_footer = true
@page_title = t('mobile.copyright')
end
def dialog_language
@no_menu = @no_footer = true
@page_title = t('mobile.language')
end
def map
@no_menu = @no_footer = true
@page_title = t('mobile.location')
end
def page
@page_title = t('mobile.page')
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
end
def page_content
@page_context = PageContext.first(conditions: { id: params[:id], :archived => false }) rescue nil
@page_title = @page_context.page.title
end
end

View File

@ -0,0 +1,11 @@
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="first">
<%= link_to_unless current_page.first?, "«", url, :remote => remote %>
</li>

View File

@ -0,0 +1,8 @@
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<!-- <li class="page gap"><%= raw(t 'views.pagination.truncate') %></li> -->

View File

@ -0,0 +1,11 @@
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="last">
<%= link_to_unless current_page.last?, "»", url, {:remote => remote} %>
</li>

View File

@ -0,0 +1,11 @@
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="next">
<%= link_to_unless current_page.last?, '', url, :rel => 'next', :remote => remote %>
</li>

View File

@ -0,0 +1,16 @@
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page<%= ' active' if page.current? %>">
<% if page.current? %>
<a><%= page %></a>
<% else %>
<%= link_to page, url, opts = {:remote => remote, :rel => page.next? ? '' : page.prev? ? '' : nil} %>
<% end %>
</li>

View File

@ -0,0 +1,25 @@
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<div class="pagination">
<ul>
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</div>
<% end -%>

View File

@ -0,0 +1,11 @@
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="prev">
<%= link_to_unless current_page.first?, '', url, :rel => 'prev', :remote => remote %>
</li>

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<base href=<%= "#{request.protocol}#{request.host_with_port}/mobile/"%>>
<title><%= @site.title %><%= (' - ' + @page_title) if @page_title %></title>
<%= stylesheet_link_tag "mobile" %>
<%= javascript_include_tag "mobile" %>
<%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false&libraries=places" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- <meta name="apple-itunes-app" content="app-id=342792525, app-argument=imdb:///?src=mdot"> -->
<meta name="description" content="">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<!-- iPhone -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone.png' %>" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPhone (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone-RETINA.png' %>" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 5 -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone-Tall-RETINA.png' %>" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad Portrait -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-Portrait.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad Landscape -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-Landscape.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad Portrait (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-RETINA-Portrait.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad Landscape (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-RETINA-Landscape.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone icon -->
<link rel="apple-touch-icon-precomposed" href="<%= asset_path 'mobile/apple-touch-icon.png' %>">
<!-- iPhone icon (Retina) -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%= asset_path 'mobile/apple-touch-icon@2x.png' %>">
<!-- iPad icon -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%= asset_path 'mobile/apple-touch-icon-ipad.png' %>">
<!-- iPad icon (Retina) -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%= asset_path 'mobile/apple-touch-icon-ipad@2x.png' %>">
</head>
<body>
<div data-role="page" data-url="<%= request.fullpath %>" id="<%= params[:action] %>" data-add-back-btn="<%= params[:action].eql?('index')? nil : 'true' %>">
<section class="global">
<% if !(yield :header).blank? %>
<%= yield :header %>
<% else %>
<%= render 'header' %>
<% end unless @no_header %>
<%= render 'menu' unless @no_menu %>
<section class="content">
<%= yield %>
</section>
<%= render 'footer' unless @no_footer %>
</section>
</div>
</body>
</html>

View File

@ -0,0 +1,24 @@
<footer class="footer" data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>
<%= link_to mobile_dialog_copyright_path, {"data-transition" => "flip", "data-rel" => "dialog", "data-inline" => "true"} do %>
<i class="icons-information"></i>
<%= t('mobile.copyright') %>
<% end %>
</li>
<li>
<%= link_to mobile_map_path, {"data-transition" => "flip"} do %>
<i class="icons-location"></i>
<%= t('mobile.location') %>
<% end %>
</li>
<li>
<%= link_to mobile_dialog_contact_path, {"data-rel" => "dialog"} do %>
<i class="icons-phone"></i>
<%= t('mobile.contact') %>
<% end %>
</li>
</ul>
</div>
</footer>

View File

@ -0,0 +1,9 @@
<header class="header" data-role="header">
<h1 class="openmenu">
<%= image_tag asset_path('mobile/logo.png') %>
</h1>
<i class="openmenu icons-arrow-bottom-e"></i>
<%= link_to mobile_dialog_language_path, {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %>
<i class="icons-earth"></i>
<% end %>
</header>

View File

@ -0,0 +1,3 @@
<header data-role="header" data-theme="d">
<h1><%= t('mobile.contact') %></h1>
</header>

View File

@ -0,0 +1,3 @@
<header data-role="header" data-theme="d">
<h1><%= t('mobile.copyright') %></h1>
</header>

View File

@ -0,0 +1,3 @@
<div data-role="header" data-theme="c">
<h3><%= t('mobile.language') %></h3>
</div>

View File

@ -0,0 +1,3 @@
<div data-role="header">
<h1><%= t('mobile.location') %></h1>
</div>

View File

@ -0,0 +1,9 @@
<div data-role="dialog" id="language_select">
<div data-role="content" data-theme="c">
<h3><%= t('mobile.language') %></h3>
<% @site_in_use_locales.each do |locale| %>
<%= link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale), {"data-role" => "button", "data-theme" => "b", "data-shadow" => "true"} %>
<% end %>
<a href="#" data-role="button" data-mini="true" data-rel="back" data-theme="a"><%= t('mobile.cancel') %></a>
</div>
</div>

View File

@ -0,0 +1,7 @@
<section class="main-menu">
<ul class="clear">
<li><%= link_to content_tag(:i, nil, :class => "icons-house") + content_tag(:span, t('mobile.home')), mobile_path %></li>
<li><%= link_to content_tag(:i, nil, :class => "icons-megaphone") + content_tag(:span, t('mobile.bulletin')), mobile_announcement_path %></li>
<li><%= link_to content_tag(:i, nil, :class => "icons-page") + content_tag(:span, t('mobile.page')), mobile_page_path %></li>
</ul>
</section>

View File

@ -0,0 +1,13 @@
<ul data-role="listview" class="list">
<% @bulletins.each do |bulletin| %>
<li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right" data-theme="c">
<%= link_to mobile_announcement_content_path(bulletin), :class => "ui-link-inherit" do %>
<%= image_tag bulletin.image.url, :class => "ui-li-thumb" %>
<h3><%= bulletin.title %></h3>
<p class="ui-li-aside ui-li-desc"><%= display_date(bulletin.postdate) %></p>
<div class="ui-li-desc"><%= bulletin.subtitle %></div>
<% end %>
</li>
<% end %>
</ul>
<%= paginate @bulletins, :param_name => :page_main, :window => 2 %>

View File

@ -0,0 +1,6 @@
<div class="newpic">
<%= image_tag @bulletin.image.url %>
</div>
<h3 class="newstitle"><%= @bulletin.title %></h3>
<p class="newsDate"><%= display_date_time(@bulletin.postdate) %></p>
<div class="newsummary"><%= @bulletin.text.html_safe rescue '' %></div>

View File

@ -0,0 +1,11 @@
<%= content_for :header do %>
<%= render 'header_dialog_contact' %>
<% end %>
<ul>
<li>總機電話:<a href="tel:+886229393091">02-29393091</a></li>
<li>傳真02-29379611</li>
<li>緊急重大事件通聯窗口:校內分機 66119、66110</li>
<li>總值日室:<a href="tel:+88229387132">02-29387132</a></li>
<li>駐警衛室:<a href="tel:+88229387129">02-29387129</a></li>
</ul>

View File

@ -0,0 +1,6 @@
<%= content_for :header do %>
<%= render 'header_dialog_copyright' %>
<% end %>
<p>本網站著作權屬於國立政治大學。</p>
<p>RulingDigital 銳綸數位建置</p>

View File

@ -0,0 +1,7 @@
<%= content_for :header do %>
<%= render 'header_dialog_language' %>
<% end %>
<% @site_in_use_locales.each do |locale| %>
<%= link_to t(:_locale, :locale => locale), add_locale(remove_locale((request.referer rescue request.fullpath)), locale), {"data-role" => "button", "data-theme" => "b", "data-shadow" => "true"} %>
<% end %>

View File

@ -0,0 +1,19 @@
<div class="slideshow">
<% @ad_banner.ad_images.each do |image| %>
<div class="slidebanner"><%= image_tag image.file.url, :class => 'slideImg' %></div>
<% end %>
</div>
<div class="newlist clear">
<% @bulletins.each do |bulletin| %>
<div class="newitem">
<div class="newpic">
<%= image_tag bulletin.image.url %>
</div>
<h3 class="newstitle">
<%= link_to bulletin.title, mobile_announcement_content_path(bulletin) %>
</h3>
<p class="newsDate"><%= display_date(bulletin.postdate) %></p>
<div class="newsummary"><%= bulletin.subtitle %></div>
</div>
<% end %>
</div>

View File

@ -0,0 +1,5 @@
<%= content_for :header do %>
<%= render 'header_map' %>
<% end %>
<div id='map_canvas'></div>

View File

@ -0,0 +1,10 @@
<ul data-role="listview" class="list">
<% @page_contexts.each do |page_context| %>
<li>
<%= link_to mobile_page_content_path(page_context) do %>
<h3><%= page_context.page.title %></h3>
<% end %>
</li>
<% end %>
</ul>
<%= paginate @page_contexts, :param_name => :page_main, :window => 2 %>

View File

@ -0,0 +1,2 @@
<h3 class="newstitle"><%= @page_context.page.title %></h3>
<div class="newsummary"><%= @page_context.context.html_safe rescue '' %></div>

View File

@ -3,3 +3,5 @@
# Add new mime types for use in respond_to blocks: # Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf # Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone # Mime::Type.register_alias "text/html", :iphone
Mime::Type.register_alias "text/html", :mobile

View File

@ -0,0 +1,11 @@
en:
mobile:
bulletin: Bulletin
contact: Contact
copyright: Copyright
home: Home
language: Language
location: Location
location_description: '<h3>國立政治大學</h3>11605 臺北市文山區指南路二段64號'
page: Page

View File

@ -0,0 +1,11 @@
zh_tw:
mobile:
bulletin: 公告
contact: 聯絡資訊
copyright: 版權宣告
home: 首頁
language: 語言
location: 地理位置
location_description: '<h3>國立政治大學</h3>11605 臺北市文山區指南路二段64號'
page: 頁面

View File

@ -241,6 +241,18 @@ Orbit::Application.routes.draw do
match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap
end end
scope '/mobile' do
match 'announcement' => 'mobile#announcement', :as => 'mobile_announcement'
match 'announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
match 'dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'
match 'dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright'
match 'dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language'
match 'map' => 'mobile#map', :as => 'mobile_map'
match 'page' => 'mobile#page', :as => 'mobile_page'
match 'page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content'
root :to => 'mobile#index', :as => 'mobile'
end
match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request| match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true") !request.query_string.include?("inner=true")