fixws and 'new' button in grid query
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,116 +1,116 @@
|
||||
$(function(){
|
||||
// hide/show header
|
||||
$('#close-open-top a').bind('click', function() {
|
||||
if($('header:visible').length) {
|
||||
$('img', this).attr('src', 'images/open.png');
|
||||
} else {
|
||||
$('img', this).attr('src', 'images/close.png');
|
||||
}
|
||||
$('header').slideToggle('slow');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// tabs
|
||||
$('.tab_content').hide();
|
||||
$('ul.tabs li:first').addClass('active').show();
|
||||
$('.tab_content:first').show();
|
||||
|
||||
$('ul.tabs li').click(function() {
|
||||
$('ul.tabs li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.tab_content').hide();
|
||||
var activeTab = $(this).find('a').attr('href');
|
||||
$(activeTab).fadeIn();
|
||||
return false;
|
||||
});
|
||||
|
||||
// hide/show default text when user focuses on newsletter subscribe field
|
||||
var defaultEmailTxt = $('#email-address').val();
|
||||
$('#email-address').focus(function() {
|
||||
if ($('#email-address').val() == defaultEmailTxt) {
|
||||
$('#email-address').val('');
|
||||
}
|
||||
});
|
||||
$('#email-address').blur(function() {
|
||||
if ($('#email-address').val() == '') {
|
||||
$('#email-address').val(defaultEmailTxt);
|
||||
}
|
||||
});
|
||||
|
||||
// Lightbox
|
||||
$(".gallery a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'dark_rounded',slideshow:4000, autoplay_slideshow: false});
|
||||
|
||||
// Tipsy
|
||||
$('#social li a img').tipsy({delayIn: 1200, delayOut: 1200, gravity: 's'});
|
||||
|
||||
// init newsletter subscription AJAX handling
|
||||
$('#newslettersubmit').click(function() { $('#newsletterform').submit(); return false; });
|
||||
$('#newsletterform').ajaxForm({dataType: 'json',
|
||||
timeout: 2000,
|
||||
success: newsletterResponse});
|
||||
|
||||
// Twitter script config
|
||||
if ($('#tweet').length) {
|
||||
getTwitters('tweet', {
|
||||
id: 'envatowebdesign',
|
||||
count: 3,
|
||||
enableLinks: true,
|
||||
ignoreReplies: true,
|
||||
template: '"%text%" <a class="meta" href="http://twitter.com/%user_screen_name%/status/%id%">%time%</a>'});
|
||||
}
|
||||
|
||||
|
||||
// init contact form validation and AJAX handling
|
||||
if ($("#contactform").length > 0) {
|
||||
$("#contactform").validate({ rules: { name: "required",
|
||||
email: { required: true, email: true },
|
||||
message: "required"},
|
||||
messages: { name: "This field is required.",
|
||||
email: { required: "This field is required.",
|
||||
email: "Please enter a valied email address."},
|
||||
message: "This field is required."},
|
||||
submitHandler: function(form) { $(form).ajaxSubmit({dataType: 'json', success: contactFormResponse}); }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// handle newsletter subscribe AJAX response
|
||||
function newsletterResponse(response) {
|
||||
if (response.responseStatus == 'err') {
|
||||
if (response.responseMsg == 'ajax') {
|
||||
alert('Error - this script can only be invoked via an AJAX call.');
|
||||
} else if (response.responseMsg == 'fileopen') {
|
||||
alert('Error opening $emailsFile. Please refer to documentation for help.');
|
||||
} else if (response.responseMsg == 'email') {
|
||||
alert('Please enter a valid email address.');
|
||||
} else if (response.responseMsg == 'duplicate') {
|
||||
alert('You are already subscribed to our newsletter.');
|
||||
} else if (response.responseMsg == 'filewrite') {
|
||||
alert('Error writing to $emailsFile. Please refer to documentation for help.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} else if (response.responseStatus == 'ok') {
|
||||
alert('Thank you for subscribing to our newsletter! We will not abuse your address.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} // newsletterResponse
|
||||
|
||||
// handle contact form AJAX response
|
||||
function contactFormResponse(response) {
|
||||
if (response.responseStatus == 'err') {
|
||||
if (response.responseMsg == 'ajax') {
|
||||
alert('Error - this script can only be invoked via an AJAX call.');
|
||||
} else if (response.responseMsg == 'notsent') {
|
||||
alert('We are having some mail server issues. Please refresh the page or try again later.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} else if (response.responseStatus == 'ok') {
|
||||
alert('Thank you for contacting us! We\'ll get back to you ASAP.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} // contactFormResponse
|
||||
$(function(){
|
||||
// hide/show header
|
||||
$('#close-open-top a').bind('click', function() {
|
||||
if($('header:visible').length) {
|
||||
$('img', this).attr('src', 'images/open.png');
|
||||
} else {
|
||||
$('img', this).attr('src', 'images/close.png');
|
||||
}
|
||||
$('header').slideToggle('slow');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// tabs
|
||||
$('.tab_content').hide();
|
||||
$('ul.tabs li:first').addClass('active').show();
|
||||
$('.tab_content:first').show();
|
||||
|
||||
$('ul.tabs li').click(function() {
|
||||
$('ul.tabs li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.tab_content').hide();
|
||||
var activeTab = $(this).find('a').attr('href');
|
||||
$(activeTab).fadeIn();
|
||||
return false;
|
||||
});
|
||||
|
||||
// hide/show default text when user focuses on newsletter subscribe field
|
||||
var defaultEmailTxt = $('#email-address').val();
|
||||
$('#email-address').focus(function() {
|
||||
if ($('#email-address').val() == defaultEmailTxt) {
|
||||
$('#email-address').val('');
|
||||
}
|
||||
});
|
||||
$('#email-address').blur(function() {
|
||||
if ($('#email-address').val() == '') {
|
||||
$('#email-address').val(defaultEmailTxt);
|
||||
}
|
||||
});
|
||||
|
||||
// Lightbox
|
||||
$(".gallery a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'dark_rounded',slideshow:4000, autoplay_slideshow: false});
|
||||
|
||||
// Tipsy
|
||||
$('#social li a img').tipsy({delayIn: 1200, delayOut: 1200, gravity: 's'});
|
||||
|
||||
// init newsletter subscription AJAX handling
|
||||
$('#newslettersubmit').click(function() { $('#newsletterform').submit(); return false; });
|
||||
$('#newsletterform').ajaxForm({dataType: 'json',
|
||||
timeout: 2000,
|
||||
success: newsletterResponse});
|
||||
|
||||
// Twitter script config
|
||||
if ($('#tweet').length) {
|
||||
getTwitters('tweet', {
|
||||
id: 'envatowebdesign',
|
||||
count: 3,
|
||||
enableLinks: true,
|
||||
ignoreReplies: true,
|
||||
template: '"%text%" <a class="meta" href="http://twitter.com/%user_screen_name%/status/%id%">%time%</a>'});
|
||||
}
|
||||
|
||||
|
||||
// init contact form validation and AJAX handling
|
||||
if ($("#contactform").length > 0) {
|
||||
$("#contactform").validate({ rules: { name: "required",
|
||||
email: { required: true, email: true },
|
||||
message: "required"},
|
||||
messages: { name: "This field is required.",
|
||||
email: { required: "This field is required.",
|
||||
email: "Please enter a valied email address."},
|
||||
message: "This field is required."},
|
||||
submitHandler: function(form) { $(form).ajaxSubmit({dataType: 'json', success: contactFormResponse}); }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// handle newsletter subscribe AJAX response
|
||||
function newsletterResponse(response) {
|
||||
if (response.responseStatus == 'err') {
|
||||
if (response.responseMsg == 'ajax') {
|
||||
alert('Error - this script can only be invoked via an AJAX call.');
|
||||
} else if (response.responseMsg == 'fileopen') {
|
||||
alert('Error opening $emailsFile. Please refer to documentation for help.');
|
||||
} else if (response.responseMsg == 'email') {
|
||||
alert('Please enter a valid email address.');
|
||||
} else if (response.responseMsg == 'duplicate') {
|
||||
alert('You are already subscribed to our newsletter.');
|
||||
} else if (response.responseMsg == 'filewrite') {
|
||||
alert('Error writing to $emailsFile. Please refer to documentation for help.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} else if (response.responseStatus == 'ok') {
|
||||
alert('Thank you for subscribing to our newsletter! We will not abuse your address.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} // newsletterResponse
|
||||
|
||||
// handle contact form AJAX response
|
||||
function contactFormResponse(response) {
|
||||
if (response.responseStatus == 'err') {
|
||||
if (response.responseMsg == 'ajax') {
|
||||
alert('Error - this script can only be invoked via an AJAX call.');
|
||||
} else if (response.responseMsg == 'notsent') {
|
||||
alert('We are having some mail server issues. Please refresh the page or try again later.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} else if (response.responseStatus == 'ok') {
|
||||
alert('Thank you for contacting us! We\'ll get back to you ASAP.');
|
||||
} else {
|
||||
alert('Undocumented error. Please refresh the page and try again.');
|
||||
}
|
||||
} // contactFormResponse
|
||||
|
||||
File diff suppressed because one or more lines are too long
+16
-16
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -66,4 +66,4 @@ function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){return'
|
||||
function _buildOverlay(caller){$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';}else{classname='';}
|
||||
toInject+="<li class='"+classname+"'><a href='#'><img src='"+pp_images[i]+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_pic_holder.find('.pp_gallery ul li').each(function(i){$(this).css({'position':'absolute','left':i*itemWidth});$(this).find('a').unbind('click').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
|
||||
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
|
||||
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);
|
||||
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@
|
||||
o.retainPath=($.inArray($$[0],o.$path)>-1);
|
||||
$$.hideSuperfishUl();
|
||||
if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
|
||||
},o.delay);
|
||||
},o.delay);
|
||||
},
|
||||
getMenu = function($menu){
|
||||
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
|
||||
@@ -36,7 +36,7 @@
|
||||
return menu;
|
||||
},
|
||||
addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
|
||||
|
||||
|
||||
return this.each(function() {
|
||||
var s = this.serial = sf.o.length;
|
||||
var o = $.extend({},sf.defaults,op);
|
||||
@@ -45,20 +45,20 @@
|
||||
.filter('li:has(ul)').removeClass(o.pathClass);
|
||||
});
|
||||
sf.o[s] = sf.op = o;
|
||||
|
||||
|
||||
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
|
||||
if (o.autoArrows) addArrow( $('>a:first-child',this) );
|
||||
})
|
||||
.not('.'+c.bcClass)
|
||||
.hideSuperfishUl();
|
||||
|
||||
|
||||
var $a = $('a',this);
|
||||
$a.each(function(i){
|
||||
var $li = $a.eq(i).parents('li');
|
||||
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
|
||||
});
|
||||
o.onInit.call(this);
|
||||
|
||||
|
||||
}).each(function() {
|
||||
var menuClasses = [c.menuClass];
|
||||
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
|
||||
@@ -159,7 +159,7 @@
|
||||
// cache all ul elements
|
||||
$ULs = $$.find('ul');
|
||||
// loop through each ul in menu
|
||||
$ULs.each(function(i) {
|
||||
$ULs.each(function(i) {
|
||||
// cache this ul
|
||||
var $ul = $ULs.eq(i);
|
||||
// get all (li) children of this ul
|
||||
@@ -199,7 +199,7 @@
|
||||
$childUl.css(offsetDirection,$ul.width());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
// expose defaults
|
||||
@@ -208,15 +208,16 @@
|
||||
maxWidth : 25, // requires em unit.
|
||||
extraWidth : 0 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
|
||||
};
|
||||
|
||||
|
||||
})(jQuery); // plugin code ends
|
||||
|
||||
/**
|
||||
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
|
||||
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
|
||||
*
|
||||
*
|
||||
* @param f onMouseOver function || An object with configuration options
|
||||
* @param g onMouseOut function || Nothing (use configuration options object)
|
||||
* @author Brian Cherne brian(at)cherne(dot)net
|
||||
*/
|
||||
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ function ajax(u,s,t) {
|
||||
}
|
||||
if (pcs.length>0){query = pcs.join("&");}
|
||||
}
|
||||
jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { if(t) { if(t==':eval') eval(msg); else jQuery("#" + t).html(msg); } } });
|
||||
jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { if(t) { if(t==':eval') eval(msg); else jQuery("#" + t).html(msg); } } });
|
||||
}
|
||||
|
||||
String.prototype.reverse = function () { return this.split('').reverse().join('');};
|
||||
@@ -30,9 +30,9 @@ function web2py_ajax_fields(target) {
|
||||
var date_format = (typeof w2p_ajax_date_format != 'undefined') ? w2p_ajax_date_format : "%Y-%m-%d";
|
||||
var datetime_format = (typeof w2p_ajax_datetime_format != 'undefined') ? w2p_ajax_datetime_format : "%Y-%m-%d %H:%M:%S";
|
||||
jQuery("input.date",target).each(function() {Calendar.setup({inputField:this, ifFormat:date_format, showsTime:false });});
|
||||
jQuery("input.datetime",target).each(function() {Calendar.setup({inputField:this, ifFormat:datetime_format, showsTime: true, timeFormat: "24" });});
|
||||
jQuery("input.datetime",target).each(function() {Calendar.setup({inputField:this, ifFormat:datetime_format, showsTime: true, timeFormat: "24" });});
|
||||
jQuery("input.time",target).each(function(){jQuery(this).timeEntry();});
|
||||
|
||||
|
||||
};
|
||||
|
||||
function web2py_ajax_init(target) {
|
||||
@@ -43,7 +43,7 @@ function web2py_ajax_init(target) {
|
||||
web2py_ajax_fields(target);
|
||||
};
|
||||
|
||||
jQuery(function() {
|
||||
jQuery(function() {
|
||||
var flash = jQuery('.flash');
|
||||
flash.hide();
|
||||
if(flash.html()) flash.slideDown();
|
||||
@@ -68,7 +68,7 @@ function web2py_trap_link(target) {
|
||||
web2py_ajax_page('get',link.attr('href'),[],target);
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
function web2py_ajax_page(method,action,data,target) {
|
||||
jQuery.ajax({'type':method,'url':action,'data':data,
|
||||
@@ -77,16 +77,16 @@ function web2py_ajax_page(method,action,data,target) {
|
||||
xhr.setRequestHeader('web2py-component-element',target);},
|
||||
'complete':function(xhr,text){
|
||||
var html=xhr.responseText;
|
||||
var content=xhr.getResponseHeader('web2py-component-content');
|
||||
var content=xhr.getResponseHeader('web2py-component-content');
|
||||
var command=xhr.getResponseHeader('web2py-component-command');
|
||||
var flash=xhr.getResponseHeader('web2py-component-flash');
|
||||
var t = jQuery('#'+target);
|
||||
if(content=='prepend') t.prepend(html);
|
||||
if(content=='prepend') t.prepend(html);
|
||||
else if(content=='append') t.append(html);
|
||||
else if(content!='hide') t.html(html);
|
||||
else if(content!='hide') t.html(html);
|
||||
web2py_trap_form(action,target);
|
||||
web2py_trap_link(target);
|
||||
web2py_ajax_init('#'+target);
|
||||
web2py_ajax_init('#'+target);
|
||||
if(command) eval(command);
|
||||
if(flash) jQuery('.flash').html(flash).slideDown();
|
||||
}
|
||||
@@ -104,3 +104,4 @@ function web2py_comet(url,onmessage,onopen,onclose) {
|
||||
return true; // supported
|
||||
} else return false; // not supported
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user