Gruntify it all

This commit is contained in:
jaywood
2014-07-09 23:44:45 -04:00
parent 7864f0917e
commit 4cc6b498fd
7 changed files with 215 additions and 18 deletions

View File

@ -1,12 +1,12 @@
// JavaScript Document
/* global cwv3_params */
jQuery(document).ready(function($) {
var wpdata = cwv3_params;
//console.log(wpdata);
var enter = $('#cw_enter_link');
var exit = $('#cw_exit_link');
if(wpdata.sd == true){
var cboxObj = $.colorbox(
if(wpdata.sd === true){
$.colorbox(
{
scrolling: false,
overlayClose: false,
@ -25,9 +25,12 @@ jQuery(document).ready(function($) {
);
enter.click(function(e){
if( typeof(e) !== "undefined" ){
e.preventDefault();
}
//console.log(e);
$.post(wpdata.admin_url, {action: wpdata.action, nonce: wpdata.nonce, id: wpdata.id, method: 'enter'}, function(e){
if(cwv3_params.enter == "#"){
$.post(wpdata.admin_url, {action: wpdata.action, nonce: wpdata.nonce, id: wpdata.id, method: 'enter'}, function(){
if(cwv3_params.enter === "#"){
$.colorbox.close();
}else{
window.location = wpdata.enter;
@ -36,7 +39,10 @@ jQuery(document).ready(function($) {
});
exit.click(function(e){
$.post(wpdata.admin_url, {action: wpdata.action, nonce: wpdata.nonce, id: wpdata.id, method: 'exit'}, function(e){
if( typeof(e) !== "undefined" ){
e.preventDefault();
}
$.post(wpdata.admin_url, {action: wpdata.action, nonce: wpdata.nonce, id: wpdata.id, method: 'exit'}, function(){
window.location = wpdata.exit;
});
});

1
js/cwv3.min.js vendored Normal file
View File

@ -0,0 +1 @@
jQuery(document).ready(function($){var wpdata=cwv3_params,enter=$("#cw_enter_link"),exit=$("#cw_exit_link");wpdata.sd===!0&&($.colorbox({scrolling:!1,overlayClose:!1,escKey:!1,inline:!0,href:"#cwv3_auth",initialWidth:"50%",maxWidth:"600px",loop:!1,onLoad:function(){$("#cboxClose").remove()},className:"cwv3_box",opacity:cwv3_params.opacity}),enter.click(function(e){"undefined"!=typeof e&&e.preventDefault(),$.post(wpdata.admin_url,{action:wpdata.action,nonce:wpdata.nonce,id:wpdata.id,method:"enter"},function(){"#"===cwv3_params.enter?$.colorbox.close():window.location=wpdata.enter})}),exit.click(function(e){"undefined"!=typeof e&&e.preventDefault(),$.post(wpdata.admin_url,{action:wpdata.action,nonce:wpdata.nonce,id:wpdata.id,method:"exit"},function(){window.location=wpdata.exit})}))});