From ed70474e0695778d4b2de90f24f028d21208b9be Mon Sep 17 00:00:00 2001 From: Cyb10101 Date: Tue, 18 Aug 2015 19:53:00 +0200 Subject: [PATCH 1/2] [TASK] File extension option for images added --- js/jquery.reject.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/jquery.reject.js b/js/jquery.reject.js index a672b81..d3bb2b4 100644 --- a/js/jquery.reject.js +++ b/js/jquery.reject.js @@ -95,6 +95,8 @@ $.reject = function(options) { // Path where images are located imagePath: './images/', + // File extension of images + imageFileExtension: 'gif', // Background color for overlay overlayBgColor: '#000', // Background transparency (0-1) @@ -364,7 +366,7 @@ $.reject = function(options) { }); element.find('#jr_inner li').css({ // Browser list items (li) - background: 'transparent url("'+opts.imagePath+'background_browser.gif") '+ + background: 'transparent url("'+opts.imagePath+'background_browser.' + opts.imageFileExtension + '") '+ 'no-repeat scroll left top' }); @@ -372,7 +374,7 @@ $.reject = function(options) { // Dynamically sets the icon background image var self = $(this); self.css('background','transparent url('+opts.imagePath+'browser_'+ - (self.parent('li').attr('id').replace(/jr_/,''))+'.gif)'+ + (self.parent('li').attr('id').replace(/jr_/,''))+'.' + opts.imageFileExtension + ')'+ ' no-repeat scroll left top'); // Send link clicks to openBrowserLinks From fbcd2a980a6c4a8da76b5ff6efdcbef754728fae Mon Sep 17 00:00:00 2001 From: Cyb10101 Date: Tue, 18 Aug 2015 22:16:23 +0200 Subject: [PATCH 2/2] [TASK] New Design added --- css/jquery.reject.css | 15 +++++++++++++++ js/jquery.reject.js | 29 +++++++++++++++++++---------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/css/jquery.reject.css b/css/jquery.reject.css index d736724..5092565 100644 --- a/css/jquery.reject.css +++ b/css/jquery.reject.css @@ -29,6 +29,7 @@ font-size: 12px; background: #FFF; border: 1px solid #CCC; + border-radius: 8px; color: #4F4F4F; margin: 0 auto; height: auto; @@ -97,6 +98,7 @@ clear: both; padding: 0; margin: 0; + float: right; } #jr_close a { @@ -112,3 +114,16 @@ padding: 10px 0 0 0; margin: 0; } + +.clear { + clear: both; +} + +.noselect { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + cursor: default; +} diff --git a/js/jquery.reject.js b/js/jquery.reject.js index d3bb2b4..b4729b5 100644 --- a/js/jquery.reject.js +++ b/js/jquery.reject.js @@ -75,7 +75,7 @@ $.reject = function(options) { // Message displayed below closing link closeMessage: 'By closing this window you acknowledge that your experience '+ 'on this website may be degraded', - closeLink: 'Close This Window', + closeTitle: 'Close This Window', closeURL: '#', // Allows closing of window with esc key @@ -218,8 +218,18 @@ $.reject = function(options) { // Load background overlay (jr_overlay) + Main wrapper (jr_wrap) + // Inner Wrapper (jr_inner) w/ opts.header (jr_header) + // opts.paragraph1/opts.paragraph2 if set - var html = '
'+ - '

'+opts.header+'

'+ + var html = '
'; + + // Display close button + html += '
'; + if(opts.close) { + html += '' + + '' + opts.closeTitle + '' + + ''; + } + html += '
'; + + html += '

'+opts.header+'

'+ (opts.paragraph1 === '' ? '' : '

'+opts.paragraph1+'

')+ (opts.paragraph2 === '' ? '' : '

'+opts.paragraph2+'

'); @@ -252,13 +262,12 @@ $.reject = function(options) { html += ''; } - // Close list and #jr_list - html += '
'+ - // Display close links/message if set - (opts.close ? ''+opts.closeLink+''+ - '

'+opts.closeMessage+'

' : '')+'
'+ + // Display close message + html += '
' + (opts.close ? '

'+opts.closeMessage+'

' : '') + '
'; + html += '
'; + // Close #jr_inner and #jr_wrap - '
'; + html += '
'; var element = $('
'+html+'
'); // Create element var size = _pageSize(); // Get page size @@ -375,7 +384,7 @@ $.reject = function(options) { var self = $(this); self.css('background','transparent url('+opts.imagePath+'browser_'+ (self.parent('li').attr('id').replace(/jr_/,''))+'.' + opts.imageFileExtension + ')'+ - ' no-repeat scroll left top'); + ' no-repeat scroll center center'); // Send link clicks to openBrowserLinks self.click(function () {