add js scaffolding
This commit is contained in:
45
js/cwv3.js
45
js/cwv3.js
@ -1,15 +1,53 @@
|
||||
/* global cwv3_params */
|
||||
|
||||
window.cwv3 = ( function( window, document, $ ){
|
||||
|
||||
var app = {};
|
||||
|
||||
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();
|
||||
|
||||
// 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 );
|
||||
@ -18,6 +56,7 @@ window.cwv3 = ( function( window, document, $ ){
|
||||
|
||||
})( window, document, jQuery );
|
||||
|
||||
/*
|
||||
jQuery(document).ready(function($) {
|
||||
var enter = $('#cw_enter_link');
|
||||
var exit = $('#cw_exit_link');
|
||||
@ -65,4 +104,4 @@ jQuery(document).ready(function($) {
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});*/
|
Reference in New Issue
Block a user