We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26931
    • 2,314 Posts
    Hi there,

    on an MODx Evo 1.0.2 ( with MaxiGallery 0.6 ) installation i tried to get MaxiGallery’s drag’n drop / sort pictures function to get working when QuickManager is enabled ... but the thumbnails in the sort picture popup won’t show up at all.

    QuickManager (1.3.3) is loaded in noConflict mode. I also tried to switch from scriptaculous to mootools in the draggabletpl.html, but that didn’t work either.
    why is it conflicting anyway? ... there’s no other js in the popup source-code?

    any ideas, workarounds?

    thanks, j
    • I enabled a jquery drag-and-drop sorting script with QuickManger loaded; I found I had to NOT load QM in noconflict mode.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26931
        • 2,314 Posts
        thanks,

        strange ... when QM is not running in noConflict mode the sorting will work, but the QM Colourbox won’t open?
        there are no other scripts that might interfere / Load jQuery in manager:false / Load jQuery in front-end is set to false too ... already incl. in my header
          • 31178
          • 128 Posts
          Quote from: sottwell at Mar 29, 2010, 06:48 PM

          I enabled a jquery drag-and-drop sorting script with QuickManger loaded; I found I had to NOT load QM in noconflict mode.

          Hi Susan,

          I am looking to solve this QuickManager(jQuery) / MaxiGallery(scriptaculous) incompatibility too. I tried all the no-conflict mode QM combionations and either got QM working but MG dragsort not or vice-versa.
          I like the idea of replacing the MaxiGallery dragsort with a jQuery version. Do you still have the code for your jQuery implimentation of this and would you be willing to share it smiley

          Thanks, Richard
          • Of course to the second question, but I’m afraid it’s no to the first one.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 31178
              • 128 Posts
              Quote from: sottwell at Feb 17, 2011, 09:07 AM

              Of course to the second question, but I’m afraid it’s no to the first one.
              Ah well, thanks anyway.

              I have figured out why it fails to work. MG is registering a couple of scripts in maxigallery.php: draggableReorder.js and mooSortables.js . As these are registered using $modx->regClientStartupScript they go in at the end of the head section. If jQuery is set up in the head before this then the jQuery library setup comes before the mooSortable script. Thus even with QM in noconflict mode it fails.

              If I comment out the regClientStartupScript in MG and hardcode the scripts into my head section before the jQuery call and use QM in noconflict mode then it all works. Though I don’t really want to have these MG scripts in every page even when the gallery is not being edited.

              Ideally I think $modx->regClientStartupScript could have an option to place scripts at the start of the head as well as the end.
                • 36416
                • 589 Posts
                Quote from: uxello at Feb 18, 2011, 12:30 PM

                If I comment out the regClientStartupScript in MG and hardcode the scripts into my head section before the jQuery call and use QM in noconflict mode then it all works. Though I don’t really want to have these MG scripts in every page even when the gallery is not being edited.

                Couldn’t you use ManagerManager MaxiGallery Backend plugin, with custom (hardcoded) HTML in manageOuterTpl?
                It works when you disable QM+ for document ID where BackendManager is set up...
                  • 31178
                  • 128 Posts
                  Quote from: Eol at Feb 18, 2011, 02:18 PM

                  Quote from: uxello at Feb 18, 2011, 12:30 PM

                  If I comment out the regClientStartupScript in MG and hardcode the scripts into my head section before the jQuery call and use QM in noconflict mode then it all works. Though I don’t really want to have these MG scripts in every page even when the gallery is not being edited.

                  Couldn’t you use ManagerManager MaxiGallery Backend plugin, with custom (hardcoded) HTML in manageOuterTpl?
                  It works when you disable QM+ for document ID where BackendManager is set up...

                  yes, a good thought, I have used this one one or two sites. It just seems overkill to solve a simple issue and some clients would not welcome the radical change in interface, though I will slowly be move all to use the backend plugin at some point. One thing I did not like about the backend plugin was the save buttons for both the gallery and then the resource itself. It is just a little confusing for some. So I am working on a variation of this with a popup modal window for the maxigallery using the ManagerManager backend plugin together with fancybox... but that is another story!

                  I have now come up with a plugin to move the mootools scripts to the top of the head if they are found. I added it to a maxigallery plugin I already had that deletes the gallery folder when resources are purged (written by Dimitri Hiverda). The code I have created is here if anyone wants it. Just add to a plugin with ’OnWebPagePrerender’ checked :

                  $e = $modx->Event;
                  if ($e->name == 'OnWebPagePrerender') {
                    if ($_SESSION['mgrInternalKey']) {
                      global $modx;
                  
                      $output = $modx->documentOutput; // get the parsed document
                      $pattern='~\<script type=\"text\/javascript\" src=\".*js\/mooSortables.js\"\>\<\/script\>~';
                      if ( preg_match($pattern, $output, $matches)) {
                      $output=preg_replace($pattern, '', $output);
                      $output = preg_replace('~(<head>)~i', '\1'.$matches[0], $output); 
                      }
                  
                      $pattern='~\<script type=\"text\/javascript\" src=\".*js\/draggableReorder.js\"\>\<\/script\>~';
                      if ( preg_match($pattern, $output, $matches)) {
                      $output=preg_replace($pattern, '', $output);
                      $output = preg_replace('~(<head>)~i', '\1'.$matches[0], $output);
                      }
                      $modx->documentOutput = $output;
                    }
                  }