We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33337
    • 3,975 Posts
    Stumbled upon this one...

    http://aciddrop.com/2008/01/03/automatically-join-your-javascript-and-css-into-a-single-file/

    Can it be added to MODx? is there any possibility OR anything similar coming in 097?
      Zaigham R - MODX Professional | Skype | Email | Twitter

      Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • 7231
      • 4,205 Posts
      For clarification it should be "joining of css OR js" grin I understood that it would join the js together with the css to form one document shocked
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 6726
        • 7,075 Posts
        Kinda got the same impression reading the title wink

        Nonetheless, a very interresting technique - I had read about it and never go to implement it - thanks for reminding Zi !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 25663 MODX Staff
          • 12,272 Posts
          That would make for a great plugin indeed, especially if it caching of the results. Looks like there’s an update available. I suspect this would be relatively straightforward to implement as a plugin for anyone that has a clue about coding from scratch (e.g., not me!):

          http://aciddrop.com/2008/01/23/site-speed-boost-script-updated/
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 28215
            • 4,149 Posts
            Quote from: rthrash at Jan 28, 2008, 11:03 AM

            That would make for a great plugin indeed, especially if it caching of the results. Looks like there’s an update available. I suspect this would be relatively straightforward to implement as a plugin for anyone that has a clue about coding from scratch (e.g., not me!):
            http://aciddrop.com/2008/01/23/site-speed-boost-script-updated/

            This would be a great thing to put into Trac.

            So, let’s start a standard here. Feature requests that have been talked about and liked go immediately into Trac.

            If we leave stuff on the board, it gets buried. smiley
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 25663 MODX Staff
              • 12,272 Posts
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 33337
                • 3,975 Posts
                Sorry for the misleading title lipsrsealed

                Good to see this made into feature list, this thing "out of the box" can be an attention seeking on its own I guess.
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link
                  • 20289
                  • 958 Posts
                  Quote from: rthrash at Jan 28, 2008, 11:03 AM

                  ... for anyone that has a clue about coding from scratch (e.g., not me!):
                  Me neither! tongue, BTW those php compressors sounds interesting http://aciddrop.com/category/php/
                    [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]
                    • 23491 ☆ A M B ☆
                    • 1,056 Posts
                    How would the compressor/aggregator handle conditionally included (Internet Explorer) style sheets?
                    Would it be able to ignore them, leaving them untouched?

                    e.g.
                            <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="assets/css/style_ie6.css" media="screen,print"/><![endif]-->
                            <!--[if gte IE 7]><link rel="stylesheet" type="text/css" href="assets/css/style_ie7.css" media="screen,print" /><![endif]--> 
                    


                    Also, I have seen some scenarios where mixed media types (media=screen, media=print, etc) become merged into one file, and it wasn’t properly handled. (IMHO)

                    Does the generated file name incorporate "versioning" to some degree? (e.g. If the file contents change, but the file name does not, etc)
                      Mike Reid - www.pixelchutes.com
                      MODx Ambassador / Contributor
                      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                      ________________________________
                      Where every pixel matters.
                      • 11975
                      • 2,542 Posts
                      Hi,

                      I’ve played a bit with the class but cannot get the js minify to work.

                      here is the current plugin code:

                      <?
                      
                      $e= & $modx->Event;
                      switch ($e->name) {
                      	
                      	case 'OnWebPagePrerender':
                      	$path = $modx->config['base_path'] . "assets/plugins/acidDrop/";
                      	include_once($path."class.compressor.php");
                      	
                      	$options = array("javascript"=>array("cachedir"=>"/assets/cache/",
                      										   "gzip"=>true,
                      										   "minify"=>true,													   
                      										   ),
                      							  "css"=>array("cachedir"=>"/assets/cache/",
                      										   "gzip"=>true,
                      										   "minify"=>true,													   
                      										   )							   
                      					   );
                      	$compressor = new compressor($options);	
                      	$modx->documentOutput = $compressor->finish($modx->documentOutput);
                      	break;
                      
                      }
                      
                      


                      the compressor needs to be modified a bit.

                      Comment this line in function compressor
                      #line 49

                      //Start things off
                      //$this->start();

                      and chenge the function finish()


                      function finish($content) //add content argument

                      and change in the same function


                      //Echo content to the browser
                      //echo $this->content;
                      return $this->content;
                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l