We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14138
    • 13 Posts
    Thanks a lot for you help!

    It’s a great snippet, you should include the documentation in the zip you provide.

    I’ll give a link to the super-secret site that I’ve been working on as soon as it’s live

    Thanks again for a great snippet
      • 26435
      • 1,193 Posts
      Quote from: jibbist at Jan 11, 2008, 04:53 PM

      Thanks a lot for you help!

      It’s a great snippet, you should include the documentation in the zip you provide.

      I’ll give a link to the super-secret site that I’ve been working on as soon as it’s live

      Thanks again for a great snippet
      It’s my pleasure. I will work on getting better documentation and including it in the download.

      I can’t wait to see what you are working on!

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 26435
        • 1,193 Posts
        TreasureChest is now licensed under the GPL v. 3.

        This has been quite an experience. I know know that I am a terrible businessman smiley I really wish I had more time to dedicate to supporting and developing this software. I trust that this recently GPL’d code will be in better hands with the MODx community than it was with me. The TC Site will stay up as a demo and for support.

        http://modxcms.com/TreasureChest-1745.html

        later

        -sD-
        Dr. Scotty Delicious, DFPA.
          Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
          All of the above... in no specific order.


          I send pointless little messages
          • 24414
          • 45 Posts
          Any chance of uploading TreasureChest with unpacked JavaScript files included now that its GPL?
            • 4310
            • 2,310 Posts
            I’d like to second ram’s request for the unpacked version to enable further customisation if Scotty can find the time.
              • 26435
              • 1,193 Posts
              Quote from: ram at May 19, 2008, 05:32 AM

              Any chance of uploading TreasureChest with unpacked JavaScript files included now that its GPL?
              I’d third that!
              I wish I could find the original. A few weeks ago, I fubar-ed my macbook pro trying to triple boot OS X, XP, and Ubuntu. What I ended up with was a zero boot.

              I am sure if I had asked here first, everyone would have said "Go ahead. Make sure you back up important projects first"

              If anyone knows how to reverse engineer the packing ( http://dean.edwards.name/packer/ ), please post. I think it is an eval statement that can decode it.

              -sD-
              Dr. Scotty Delicious, DFPA.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 24414
                • 45 Posts
                It is possible to unpack by creating an HTML document with the packed script as the content and by replacing eval() with document.write().

                This will dump script contents to screen - I did this in WebKit/Inspect Element, but there seem to be some errors that have crept in, unfortunately my knowledge of jQuery (and time) is quite limited so I haven’t managed to get too far with it.

                treasurechest.js - TreasureChest-specific functions
                function emptyCart() {
                	$.post(cart_doc,{ action:'count' }, function(a) { cart_count = eval("("+a+")"); if(!cart_count.length) { tb_remove(); $(cart_el).animate({ opacity:'0.0' }, 'slow', function() { $(cart_el).html('') });
                		return false
                	} else {
                		if(confirm(cart_warn)) {
                			$.post(cart_doc, { action:'empty' });
                			$(cart_el).animate({ opacity:'0.0' }, 'slow', function() { $(cart_el).html('') } )
                		}
                	}});
                
                return false
                
                }
                
                function checkout(a) {
                	
                	TB_remove();
                	
                	jQuery('#treasureChestCheckout').remove();
                	
                	jQuery('<div id="treasureChestCheckout">'+a+'</div>').appendTo('body').hide();
                	document.paypal.submit()
                
                }
                
                
                function cartCount() {
                	
                	$.post(cart_doc,{action:'count'},function(a) {
                		cart_count=eval("("+a+")");
                	
                		if(cart_count.length) {
                			cart_string='<a class="thickbox tc_view" title="'+cart_view+'" href="#" onclick="return false;">
                		
                			'+'
                		
                			<span class="tc_cart_view_text">'+cart_view+'</span>
                			<span class="tc_cart_count">'+cart_count.length+'</span>
                		
                			</a>
                		
                			'+'
                		
                			<a class="tc_cart_empty '+class_empty+'" href="#" title="'+cart_empty+'">'+cart_empty+'</a>';
                		
                		$(cart_el).show().html(cart_string);
                		
                		$('.tc_view').click(function() {
                		
                			if(!cart_count.length) {
                				emptyCart()
                			}
                			
                			TB_show(cart_name,cart_doc+'&TB_iframe=true&height=350&width=500&action=view',false);
                			return false
                		})
                	} else {
                		$(cart_el).hide();
                		return false
                	}
                	
                	$('a.'+class_empty).click(emptyCart);
                	
                	return true
                })
                
                }
                
                
                function addToCart(a,b,c) {
                
                	$.post(cart_doc,{ action:'add',selector:b,item:c }, cartCount);
                	$(cart_el).animate({ opacity:'0.2' },'fast').animate({ opacity:'1.0' },'normal');
                	$(a).animate({ opacity:'0.0' },'fast').animate({ opacity:'1.0' },'normal');
                	return false
                
                }
                	
                	
                	
                function tcConfig(a) {
                
                	config = eval("("+a+")");
                	cart_name=config['business_name'];
                	cart_view=config['cart_view'];
                	cart_empty=config['cart_empty'];
                	cart_warn=config['cart_warn'];
                	cart_el=config['cart_el'];
                	class_add=config['class_add'];
                	class_empty=config['class_empty'];
                	
                	$('.'+class_add).click(function() { addToCart(this,this.rel,this.name); return false });
                	
                	cartCount()
                	
                }
                
                function paypalForm(a) {
                	
                	$.post(cart_doc,{
                		action:'item_opts', name:a.name, value:a.value } );
                		op_field=a.name;
                		$('.'+op_field).val(a.value)
                	}
                	
                	emptyCartFunction = emptyCart;
                	
                	checkoutFunction = checkout;
                	cartCountFunction = cartCount;
                	addToCartFunction = addToCart;
                	checkoutFunction = checkout;
                	prepPaypal = paypalForm;
                	
                	$(document).ready(function() { $.post(cart_doc,{ action:'config' },tcConfig);
                	$('.hover-info').Tooltip({ track:true, delay:0, showURL:false, fixPNG:true, showBody:' - ',extraClass:'hover', top:-15, left:5 });
                	$('<span style="display:none;" id="treasureChestCopyright">Powered By ©Treasure Chest 1.0 by Scotty Delicious</span>').appendTo('body').hide() });
                	$(document).keypress(function(e) {
                		if(e.which==27) {
                			tb_remove();
                			cartCount()
                		}
                	});
                }
                
                  • 26435
                  • 1,193 Posts
                  Hell yes Ram!
                  You are now "Ultimate Skeletor" of TreasureChest.
                  Thanks for posting that.
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 24414
                    • 45 Posts
                    That’s cool, if someone else that has a bit more of a clue than me maybe they can get it back to a working script again.

                    I got as far as formatting the code so that it was readable, it just doesn’t function yet, didn’t get as far as debugging.
                      • 20289
                      • 958 Posts
                      Quote from: Dr. at May 19, 2008, 10:07 AM

                      I am sure if I had asked here first, everyone would have said "Go ahead. Make sure you back up important projects first"

                      I suggest using Active@ File Recovery which helped me recover once!
                        [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                        [td][Wiki] [Persian support forum]
                        [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                        [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]