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

Commit

Permalink
Optimized Makefile and core js/css
Browse files Browse the repository at this point in the history
Removed redundant Makefile macros and reorganised build terms. Removed border-radius reset on ui-tooltip-wrapper element. Removed some extra whitesapce in core.js file.
  • Loading branch information
Craga89 committed Jul 18, 2010
1 parent d690d03 commit 2b06097
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 49 deletions.
41 changes: 18 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,22 @@ PREFIX = .
DIST_DIR = ${PREFIX}/dist
IMG_DIR = ${PREFIX}/images

JS_FILES = ${SRC_DIR}/core.js\
JS_MODULES = ${SRC_DIR}/header.txt\
${SRC_DIR}/intro.js\
${SRC_DIR}/core.js\
${SRC_DIR}/ajax.js\
${SRC_DIR}/tips.js\
${SRC_DIR}/imagemap.js\
${SRC_DIR}/modal.js\
${SRC_DIR}/ie6.js

JS_MODULES = ${SRC_DIR}/header.txt\
${SRC_DIR}/intro.js\
${JS_FILES}\
${SRC_DIR}/ie6.js\
${SRC_DIR}/outro.js

CSS_FILES = ${SRC_DIR}/core.css\
CSS_MODULES = ${SRC_DIR}/header.txt\
${SRC_DIR}/core.css\
${SRC_DIR}/tips.css\
${SRC_DIR}/modal.css\
${SRC_DIR}/extra.css

CSS_MODULES = ${SRC_DIR}/header.txt\
${CSS_FILES}

QTIP = ${DIST_DIR}/jquery.qtip.js
QTIP_MIN = ${DIST_DIR}/jquery.qtip.min.js
QTIP_CSS = ${DIST_DIR}/jquery.qtip.css
Expand All @@ -39,14 +35,9 @@ MINIFY = php ${BUILD_DIR}/minify.php

DATE=`git log -1 | grep Date: | sed 's/[^:]*: *//'`

all: qtip css images min lint
@@echo "qTip build complete."

${DIST_DIR}:
@@mkdir -p ${DIST_DIR}

qtip: ${DIST_DIR} ${QTIP}

${QTIP}: ${JS_MODULES}
@@mkdir -p ${DIST_DIR}

Expand All @@ -55,6 +46,17 @@ ${QTIP}: ${JS_MODULES}
sed 's/Date:./&'"${DATE}"'/' | \
${VER} > ${QTIP};

all: qtip css images min lint
@@echo "qTip build complete."

qtip: ${DIST_DIR} ${QTIP}

min: ${QTIP}
@@echo "Building" ${QTIP_MIN}

@@head -17 ${QTIP} > ${QTIP_MIN}
@@${MINIFY} ${QTIP} ${QTIP_MIN}

css: ${DIST_DIR} ${CSS_MODULES}
@@echo "Building" ${QTIP_CSS}
@@cat ${CSS_MODULES} | \
Expand All @@ -63,7 +65,7 @@ css: ${DIST_DIR} ${CSS_MODULES}


images: ${DIST_DIR}
@@echo "Building " ${QTIP_IMG}
@@echo "Building" ${QTIP_IMG}
@@mkdir ${QTIP_IMG}
@@cp -R ${IMG_DIR}/*.png ${QTIP_IMG}

Expand All @@ -73,13 +75,6 @@ lint: ${QTIP}
@@${RHINO} build/jslint-check.js


min: ${QTIP}
@@echo "Building" ${QTIP_MIN}

@@head -17 ${QTIP} > ${QTIP_MIN}
@@${MINIFY} ${QTIP} ${QTIP_MIN}


clean:
@@echo "Removing distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}
4 changes: 0 additions & 4 deletions src/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ div.ui-tooltip, div.qtip{

border-width: 3px;
border-style: solid;

-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0;
}

div.ui-tooltip .ui-tooltip-content{
Expand Down
34 changes: 12 additions & 22 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ function QTip(target, options, id)
* Public API methods
*/
$.extend(self, {

render: function(show)
{
var elements = self.elements;
Expand Down Expand Up @@ -764,7 +763,6 @@ function QTip(target, options, id)

// Use basic fade function
else {

tooltip['fade'+(state?'In':'Out')](90, after);
}

Expand Down Expand Up @@ -1154,7 +1152,7 @@ $.fn.qtip.bind = function(opts)
if($(this).attr('title')) {
$(this).data('oldtitle', $(this).attr('title')).removeAttr('title');
}

// Initialize plugins
$.each($.fn.qtip.plugins, function() {
if(this.initialize === 'initialize') { this(self); }
Expand Down Expand Up @@ -1212,23 +1210,21 @@ $.each({
var api = $(this).data('qtip');
return (arguments.length === 1 && attr === 'title' && api && api.rendered === TRUE) ? $(this).data('oldtitle') : NULL;
},

/* Taken directly from jQuery 1.8.2 widget source code */
/* Trigger 'remove' event on all elements on removal if jQuery UI isn't present */
remove: function( selector, keepData ) {
if(!$.ui) {
this.each(function() {
if (!keepData) {
if (!selector || $.filter( selector, [ this ] ).length) {
$('*', this).add(this).each(function() {
$(this).triggerHandler('remove');
});
}
remove: $.ui ? NULL : function( selector, keepData ) {
this.each(function() {
if (!keepData) {
if (!selector || $.filter( selector, [ this ] ).length) {
$('*', this).add(this).each(function() {
$(this).triggerHandler('remove');
});
}
});
}
}
});
}
},
},
function(name, func) {
var old = $.fn[name];
$.fn[name] = function() {
Expand Down Expand Up @@ -1261,12 +1257,9 @@ $.fn.qtip.defaults = {
prerender: FALSE,
id: FALSE,
overwrite: TRUE,

// Metadata
metadata: {
type: 'class'
},
// Content
content: {
text: TRUE,
attr: 'title',
Expand All @@ -1276,7 +1269,6 @@ $.fn.qtip.defaults = {
button: FALSE
}
},
// Position
position: {
my: 'top left',
at: 'bottom right',
Expand All @@ -1291,7 +1283,6 @@ $.fn.qtip.defaults = {
offset: FALSE
}
},
// Effects
show: {
target: FALSE,
event: 'mouseenter',
Expand All @@ -1312,7 +1303,6 @@ $.fn.qtip.defaults = {
classes: '',
widget: TRUE
},
// Callbacks
events: {
render: noop,
move: noop,
Expand Down

0 comments on commit 2b06097

Please sign in to comment.