diff --git a/.c9revisions/jquery.flip.js.c9save b/.c9revisions/jquery.flip.js.c9save new file mode 100644 index 0000000..04e8e45 --- /dev/null +++ b/.c9revisions/jquery.flip.js.c9save @@ -0,0 +1,3 @@ +{"ts":1351012056049,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"/*\n * Flip! jQuery Plugin (http://lab.smashup.it/flip/)\n * @author Luca Manno (luca@smashup.it) [http://i.smashup.it]\n * [Original idea by Nicola Rizzo (thanks!)]\n *\n * @version 0.9.9 [Nov. 2009]\n *\n * @changelog\n * v 0.9.9 -> Fix transparency over non-colored background. Added dontChangeColor option.\n * Added $clone and $this parameters to on.. callback functions.\n * Force hexadecimal color values. Made safe for noConflict use.\n * Some refactoring. [Henrik Hjelte, Jul. 10, 2009]\n * \t\t\t\t\t\tAdded revert options, fixes and improvements on color management.\n * \t\t\t\t\t\tReleased in Nov 2009\n * v 0.5 -> Added patch to make it work with Opera (thanks to Peter Siewert), Added callbacks [Feb. 1, 2008]\n * v 0.4.1 -> Fixed a regression in Chrome and Safari caused by getTransparent [Oct. 1, 2008]\n * v 0.4 -> Fixed some bugs with transparent color. Now Flip! works on non-white backgrounds | Update: jquery.color.js plugin or jqueryUI still needed :( [Sept. 29, 2008]\n * v 0.3 -> Now is possibile to define the content after the animation.\n * (jQuery object or text/html is allowed) [Sept. 25, 2008]\n * v 0.2 -> Fixed chainability and buggy innertext rendering (xNephilimx thanks!)\n * v 0.1 -> Starting release [Sept. 11, 2008]\n *\n */\n(function($) {\n\nfunction int_prop(fx){\n fx.elem.style[ fx.prop ] = parseInt(fx.now,10) + fx.unit;\n}\n\nvar throwError=function(message) {\n throw({name:\"jquery.flip.js plugin error\",message:message});\n};\n\nvar isIE6orOlder=function() {\n // User agent sniffing is clearly out of fashion and $.browser will be be deprectad.\n // Now, I can't think of a way to feature detect that IE6 doesn't show transparent\n // borders in the correct way.\n // Until then, this function will do, and be partly political correct, allowing\n // 0.01 percent of the internet users to tweak with their UserAgent string.\n //\n // Not leadingWhiteSpace is to separate IE family from, well who knows?\n // Maybe some version of Opera?\n // The second guess behind this is that IE7+ will keep supporting maxHeight in the future.\n\t\n\t// First guess changed to dean edwards ie sniffing http://dean.edwards.name/weblog/2007/03/sniff/\n return (/*@cc_on!@*/false && (typeof document.body.style.maxHeight === \"undefined\"));\n};\n\n\n// Some named colors to work with\n// From Interface by Stefan Petre\n// http://interface.eyecon.ro/\n\nvar colors = {\n\taqua:[0,255,255],\n\tazure:[240,255,255],\n\tbeige:[245,245,220],\n\tblack:[0,0,0],\n\tblue:[0,0,255],\n\tbrown:[165,42,42],\n\tcyan:[0,255,255],\n\tdarkblue:[0,0,139],\n\tdarkcyan:[0,139,139],\n\tdarkgrey:[169,169,169],\n\tdarkgreen:[0,100,0],\n\tdarkkhaki:[189,183,107],\n\tdarkmagenta:[139,0,139],\n\tdarkolivegreen:[85,107,47],\n\tdarkorange:[255,140,0],\n\tdarkorchid:[153,50,204],\n\tdarkred:[139,0,0],\n\tdarksalmon:[233,150,122],\n\tdarkviolet:[148,0,211],\n\tfuchsia:[255,0,255],\n\tgold:[255,215,0],\n\tgreen:[0,128,0],\n\tindigo:[75,0,130],\n\tkhaki:[240,230,140],\n\tlightblue:[173,216,230],\n\tlightcyan:[224,255,255],\n\tlightgreen:[144,238,144],\n\tlightgrey:[211,211,211],\n\tlightpink:[255,182,193],\n\tlightyellow:[255,255,224],\n\tlime:[0,255,0],\n\tmagenta:[255,0,255],\n\tmaroon:[128,0,0],\n\tnavy:[0,0,128],\n\tolive:[128,128,0],\n\torange:[255,165,0],\n\tpink:[255,192,203],\n\tpurple:[128,0,128],\n\tviolet:[128,0,128],\n\tred:[255,0,0],\n\tsilver:[192,192,192],\n\twhite:[255,255,255],\n\tyellow:[255,255,0],\n\ttransparent: [255,255,255]\n};\n\nvar acceptHexColor=function(color) {\n\tif(color && color.indexOf(\"#\")==-1 && color.indexOf(\"(\")==-1){\n\t\treturn \"rgb(\"+colors[color].toString()+\")\";\n\t} else {\n\t\treturn color;\n\t}\n};\n\n$.extend( $.fx.step, {\n borderTopWidth : int_prop,\n borderBottomWidth : int_prop,\n borderLeftWidth: int_prop,\n borderRightWidth: int_prop\n});\n\n$.fn.revertFlip = function(){\n\treturn this.each( function(){\n\t\tvar $this = $(this);\n\t\t$this.flip($this.data('flipRevertedSettings'));\t\t\n\t});\n};\n\n$.fn.flip = function(settings){\n return this.each( function() {\n var $this=$(this), flipObj, $clone, dirOption, dirOptions, newContent, ie6=isIE6orOlder();\n\n if($this.data('flipLock')){\n return false;\n }\n\t\t\n\t\tvar revertedSettings = {\n\t\t\tdirection: (function(direction){\n\t\t\t\tswitch(direction)\n\t\t\t\t{\n\t\t\t\tcase \"tb\":\n\t\t\t\t return \"bt\";\n\t\t\t\tcase \"bt\":\n\t\t\t\t return \"tb\";\n\t\t\t\tcase \"lr\":\n\t\t\t\t return \"rl\";\n\t\t\t\tcase \"rl\":\n\t\t\t\t return \"lr\";\t\t \n\t\t\t\tdefault:\n\t\t\t\t return \"bt\";\n\t\t\t\t}\n\t\t\t})(settings.direction),\n\t\t\tbgColor: acceptHexColor(settings.color) || \"#999\",\n\t\t\tcolor: acceptHexColor(settings.bgColor) || $this.css(\"background-color\"),\n\t\t\tcontent: $this.html(),\n\t\t\tspeed: settings.speed || 500,\n onBefore: settings.onBefore || function(){},\n onEnd: settings.onEnd || function(){},\n onAnimation: settings.onAnimation || function(){}\n\t\t};\n\t\t\n\t\t$this\n\t\t\t.data('flipRevertedSettings',revertedSettings)\n\t\t\t.data('flipLock',1)\n\t\t\t.data('flipSettings',revertedSettings);\n\n flipObj = {\n width: $this.width(),\n height: $this.height(),\n bgColor: acceptHexColor(settings.bgColor) || $this.css(\"background-color\"),\n fontSize: $this.css(\"font-size\") || \"12px\",\n direction: settings.direction || \"tb\",\n toColor: acceptHexColor(settings.color) || \"#999\",\n speed: settings.speed || 500,\n top: $this.offset().top,\n left: $this.offset().left,\n target: settings.content || null,\n transparent: \"transparent\",\n dontChangeColor: settings.dontChangeColor || false,\n onBefore: settings.onBefore || function(){},\n onEnd: settings.onEnd || function(){},\n onAnimation: settings.onAnimation || function(){}\n };\n\n // This is the first part of a trick to support\n // transparent borders using chroma filter for IE6\n // The color below is arbitrary, lets just hope it is not used in the animation\n ie6 && (flipObj.transparent=\"#123456\");\n\n $clone= $this.css(\"visibility\",\"hidden\")\n .clone(true)\n\t\t\t.data('flipLock',1)\n .appendTo(\"body\")\n .html(\"\")\n .css({visibility:\"visible\",position:\"absolute\",left:flipObj.left,top:flipObj.top,margin:0,zIndex:9999,\"-webkit-box-shadow\":\"0px 0px 0px #000\",\"-moz-box-shadow\":\"0px 0px 0px #000\"});\n\n var defaultStart=function() {\n return {\n backgroundColor: flipObj.transparent,\n fontSize:0,\n lineHeight:0,\n borderTopWidth:0,\n borderLeftWidth:0,\n borderRightWidth:0,\n borderBottomWidth:0,\n borderTopColor:flipObj.transparent,\n borderBottomColor:flipObj.transparent,\n borderLeftColor:flipObj.transparent,\n borderRightColor:flipObj.transparent,\n\t\t\t\tbackground: \"none\",\n borderStyle:'solid',\n height:0,\n width:0\n };\n };\n var defaultHorizontal=function() {\n var waist=(flipObj.height/100)*25;\n var start=defaultStart();\n start.width=flipObj.width;\n return {\n \"start\": start,\n \"first\": {\n borderTopWidth: 0,\n borderLeftWidth: waist,\n borderRightWidth: waist,\n borderBottomWidth: 0,\n borderTopColor: '#999',\n borderBottomColor: '#999',\n top: (flipObj.top+(flipObj.height/2)),\n left: (flipObj.left-waist)},\n \"second\": {\n borderBottomWidth: 0,\n borderTopWidth: 0,\n borderLeftWidth: 0,\n borderRightWidth: 0,\n borderTopColor: flipObj.transparent,\n borderBottomColor: flipObj.transparent,\n top: flipObj.top,\n left: flipObj.left}\n };\n };\n var defaultVertical=function() {\n var waist=(flipObj.height/100)*25;\n var start=defaultStart();\n start.height=flipObj.height;\n return {\n \"start\": start,\n \"first\": {\n borderTopWidth: waist,\n borderLeftWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: waist,\n borderLeftColor: '#999',\n borderRightColor: '#999',\n top: flipObj.top-waist,\n left: flipObj.left+(flipObj.width/2)},\n \"second\": {\n borderTopWidth: 0,\n borderLeftWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderLeftColor: flipObj.transparent,\n borderRightColor: flipObj.transparent,\n top: flipObj.top,\n left: flipObj.left}\n };\n };\n\n dirOptions = {\n \"tb\": function () {\n var d=defaultHorizontal();\n d.start.borderTopWidth=flipObj.height;\n d.start.borderTopColor=flipObj.bgColor;\n d.second.borderBottomWidth= flipObj.height;\n d.second.borderBottomColor= flipObj.toColor;\n return d;\n },\n \"bt\": function () {\n var d=defaultHorizontal();\n d.start.borderBottomWidth=flipObj.height;\n d.start.borderBottomColor= flipObj.bgColor;\n d.second.borderTopWidth= flipObj.height;\n d.second.borderTopColor= flipObj.toColor;\n return d;\n },\n \"lr\": function () {\n var d=defaultVertical();\n d.start.borderLeftWidth=flipObj.width;\n d.start.borderLeftColor=flipObj.bgColor;\n d.second.borderRightWidth= flipObj.width;\n d.second.borderRightColor= flipObj.toColor;\n return d;\n },\n \"rl\": function () {\n var d=defaultVertical();\n d.start.borderRightWidth=flipObj.width;\n d.start.borderRightColor=flipObj.bgColor;\n d.second.borderLeftWidth= flipObj.width;\n d.second.borderLeftColor= flipObj.toColor;\n return d;\n }\n };\n\n dirOption=dirOptions[flipObj.direction]();\n\n // Second part of IE6 transparency trick.\n ie6 && (dirOption.start.filter=\"chroma(color=\"+flipObj.transparent+\")\");\n\n newContent = function(){\n var target = flipObj.target;\n return target && target.jquery ? target.html() : target;\n };\n\n $clone.queue(function(){\n flipObj.onBefore($clone,$this);\n $clone.html('').css(dirOption.start);\n $clone.dequeue();\n });\n\n $clone.animate(dirOption.first,flipObj.speed);\n\n $clone.queue(function(){\n flipObj.onAnimation($clone,$this);\n $clone.dequeue();\n });\n $clone.animate(dirOption.second,flipObj.speed);\n\n $clone.queue(function(){\n if (!flipObj.dontChangeColor) {\n $this.css({backgroundColor: flipObj.toColor});\n }\n $this.css({visibility: \"visible\"});\n\n var nC = newContent();\n if(nC){$this.html(nC);}\n $clone.remove();\n flipObj.onEnd($clone,$this);\n $this.removeData('flipLock');\n $clone.dequeue();\n });\n });\n};\n})(jQuery);\n"]],"start1":0,"start2":0,"length1":0,"length2":11771}]],"length":11771} +{"contributors":[],"silentsave":false,"ts":1351012487275,"patch":[[{"diffs":[[0,"End: settings.on"],[1,"Revert"],[0,"End || function("]],"start1":4817,"start2":4817,"length1":32,"length2":38},{"diffs":[[0,"|| function(){},"],[1," "],[0,"\n onA"]],"start1":4843,"start2":4843,"length1":32,"length2":44}]],"length":11789,"saved":false} +{"ts":1351013017140,"patch":[[{"diffs":[[0,"ettings.onBefore"],[1,"Revert"],[0," || function(){}"]],"start1":4769,"start2":4769,"length1":32,"length2":38}]],"length":11795,"saved":false} diff --git a/jquery.flip.js b/jquery.flip.js index 8eb7e0b..190ca73 100644 --- a/jquery.flip.js +++ b/jquery.flip.js @@ -148,8 +148,8 @@ $.fn.flip = function(settings){ color: acceptHexColor(settings.bgColor) || $this.css("background-color"), content: $this.html(), speed: settings.speed || 500, - onBefore: settings.onBefore || function(){}, - onEnd: settings.onEnd || function(){}, + onBefore: settings.onBeforeRevert || function(){}, + onEnd: settings.onRevertEnd || function(){}, onAnimation: settings.onAnimation || function(){} };