Merge conflict

This commit is contained in:
Jay Wood
2014-11-09 16:28:50 -05:00
2 changed files with 42 additions and 3 deletions

View File

@ -1,15 +1,53 @@
/* global cwv3_params */ /* global cwv3_params */
window.cwv3 = ( function( window, document, $ ){ window.cwv3 = ( function( window, document, $ ){
var app = {}; var app = {};
app.cache = function(){ app.cache = function(){
app.$dialog = $('.cwv3_dialog');
app.$auth = app.$dialog.find( '.cwv3.auth' );
app.$denial = app.$dialog.find( '.cwv3.denied' );
app.$exit = app.$dialog.find( '.cwv3_exit' );
app.$enter = app.$dialog.find( '.cwv3_enter' );
}; };
app.init = function(){ app.init = function(){
app.cache();
// Register handlers
$( 'body' ).on( 'click', '.cwv3_enter', app.enter_handler );
$( 'body' ).on( 'click', '.cwv3_exit', app.exit_handler );
};
app.enter_handler = function( evt ){
evt.preventDefault();
};
app.exit_handler = function( evt ){
evt.preventDefault();
};
app.set_cookie = function(){
// Set the cookie
};
app.show_colorbox = function(){
// Here we show colorbox
$.colorbox({
scrolling : false,
overlayClose : false,
escKey : false,
inline : true,
href : '#cwv3_dialog',
loop : false,
className : 'cwv3_dialog',
opacity : cwv3_params.opacity,
onLoad : function(){
$('#cboxClose').remove();
},
});
}; };
$( document ).ready( app.init ); $( document ).ready( app.init );
@ -17,6 +55,7 @@ window.cwv3 = ( function( window, document, $ ){
return app; return app;
})( window, document, jQuery ); })( window, document, jQuery );
/* /*
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
var enter = $('#cw_enter_link'); var enter = $('#cw_enter_link');

2
js/cwv3.min.js vendored
View File

@ -1 +1 @@
window.cwv3=function(window,document,$){var app={};return app.cache=function(){},app.init=function(){},$(document).ready(app.init),app}(window,document,jQuery),jQuery(document).ready(function($){var enter=$("#cw_enter_link"),exit=$("#cw_exit_link");"1"===cwv3_params.sd&&($.colorbox({scrolling:!1,overlayClose:!1,escKey:!1,inline:!0,href:"#cwv3_auth",maxWidth:"80%",loop:!1,onLoad:function(){$("#cboxClose").remove()},className:"cwv3_box",opacity:cwv3_params.opacity}),enter.click(function(e){"undefined"!=typeof e&&e.preventDefault(),$.post(cwv3_params.admin_url,{action:cwv3_params.action,nonce:cwv3_params.nonce,id:cwv3_params.id,method:"enter"},function(){"#"===cwv3_params.enter?$.colorbox.close():window.location=cwv3_params.enter})}),exit.click(function(e){"undefined"!=typeof e&&e.preventDefault(),$.post(cwv3_params.admin_url,{action:cwv3_params.action,nonce:cwv3_params.nonce,id:cwv3_params.id,method:"exit"},function(){window.location=cwv3_params.exit})}))}); window.cwv3=function(window,document,$){var app={};return app.cache=function(){app.$dialog=$(".cwv3_dialog"),app.$auth=app.$dialog.find(".cwv3.auth"),app.$denial=app.$dialog.find(".cwv3.denied"),app.$exit=app.$dialog.find(".cwv3_exit"),app.$enter=app.$dialog.find(".cwv3_enter")},app.init=function(){app.cache(),$("body").on("click",".cwv3_enter",app.enter_handler),$("body").on("click",".cwv3_exit",app.exit_handler)},app.enter_handler=function(evt){evt.preventDefault()},app.exit_handler=function(evt){evt.preventDefault()},app.set_cookie=function(){},app.show_colorbox=function(){$.colorbox({scrolling:!1,overlayClose:!1,escKey:!1,inline:!0,href:"#cwv3_dialog",loop:!1,className:"cwv3_dialog",opacity:cwv3_params.opacity,onLoad:function(){$("#cboxClose").remove()}})},$(document).ready(app.init),app}(window,document,jQuery);