Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Removed use of $.error in favour of custom log function
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Jun 6, 2011
1 parent 1e2b0e3 commit 404d866
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
12 changes: 8 additions & 4 deletions dist/jquery.qtip.basic.js
Expand Up @@ -9,11 +9,11 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun Jun 5 11:43:07 2011 +0100
* Date: Mon Jun 6 17:14:09 2011 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */
/*global window: false, jQuery: false, console: false */


(function($, window, undefined) {
Expand All @@ -40,6 +40,10 @@
oldtitle = 'oldtitle',
trackingBound = FALSE;

function log(msg) {
if(!console) { (console.info || console.log || $.noop)(msg); }
}

// Option object sanitizer
function sanitizeOptions(opts)
{
Expand Down Expand Up @@ -1460,7 +1464,7 @@ function init(id, opts)

// If we don't get an object returned attempt to parse it manualyl without parseJSON
try { html5 = typeof html5 === 'string' ? (new Function("return " + html5))() : html5; }
catch(e) { $.error('Unable to parse HTML5 attribute data: ' + html5); }
catch(e) { log('Unable to parse HTML5 attribute data: ' + html5); }

// Merge in and sanitize metadata
config = $.extend(TRUE, {}, QTIP.defaults, opts,
Expand All @@ -1480,7 +1484,7 @@ function init(id, opts)

// No valid content was found, abort render
else {
$.error('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
log('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
return FALSE;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun Jun 5 11:43:07 2011 +0100
* Date: Mon Jun 6 17:14:09 2011 +0100
*/

/* Core qTip styles */
Expand Down
12 changes: 8 additions & 4 deletions dist/jquery.qtip.js
Expand Up @@ -9,11 +9,11 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun Jun 5 11:43:07 2011 +0100
* Date: Mon Jun 6 17:14:09 2011 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */
/*global window: false, jQuery: false, console: false */


(function($, window, undefined) {
Expand All @@ -40,6 +40,10 @@
oldtitle = 'oldtitle',
trackingBound = FALSE;

function log(msg) {
if(!console) { (console.info || console.log || $.noop)(msg); }
}

// Option object sanitizer
function sanitizeOptions(opts)
{
Expand Down Expand Up @@ -1460,7 +1464,7 @@ function init(id, opts)

// If we don't get an object returned attempt to parse it manualyl without parseJSON
try { html5 = typeof html5 === 'string' ? (new Function("return " + html5))() : html5; }
catch(e) { $.error('Unable to parse HTML5 attribute data: ' + html5); }
catch(e) { log('Unable to parse HTML5 attribute data: ' + html5); }

// Merge in and sanitize metadata
config = $.extend(TRUE, {}, QTIP.defaults, opts,
Expand All @@ -1480,7 +1484,7 @@ function init(id, opts)

// No valid content was found, abort render
else {
$.error('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
log('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
return FALSE;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/core.js
Expand Up @@ -1418,7 +1418,7 @@ function init(id, opts)

// If we don't get an object returned attempt to parse it manualyl without parseJSON
try { html5 = typeof html5 === 'string' ? (new Function("return " + html5))() : html5; }
catch(e) { $.error('Unable to parse HTML5 attribute data: ' + html5); }
catch(e) { log('Unable to parse HTML5 attribute data: ' + html5); }

// Merge in and sanitize metadata
config = $.extend(TRUE, {}, QTIP.defaults, opts,
Expand All @@ -1438,7 +1438,7 @@ function init(id, opts)

// No valid content was found, abort render
else {
$.error('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
log('Unable to locate content for tooltip! Aborting render of tooltip ' + id + '...');
return FALSE;
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/intro.js
@@ -1,5 +1,5 @@
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */
/*global window: false, jQuery: false, console: false */


(function($, window, undefined) {
Expand All @@ -26,3 +26,7 @@
oldtitle = 'oldtitle',
trackingBound = FALSE;

function log(msg) {
if(!console) { (console.info || console.log || $.noop)(msg); }
}

0 comments on commit 404d866

Please sign in to comment.