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

    I’ve written a javascript that uses scriptaculous to allow the order of images in a MaxiGallery to be set by dragging thumbnails in the manager.

    More complete instructions on use are in the main javascript file, draggableReorder.js, but briefly:

    1) put it in assets/snippets/maxigallery/js,
    2) if you haven’t altered the templates/managepicturetpl.html and templates/manageoutertpl.html files, just back them up and copy the ones from the zip file into assets/snippets/maxigallery/templates
    3) backup assets/snippets/maxigallery/maxigallery.php, then search for:
    $mg->regScriptsAndCSS();
    and just after the first occurance, insert:
    $modx->regClientStartupScript($modx->config[’base_url’] . ’assets/snippets/maxigallery/js/draggableReorder.js’);
    4) copy the included file draggabletpl.html into assets/snippets/maxigallery/templates

    Now log in to your web site as a user who can manage your maxigallery. Click on Manage Pictures, and an extra button should show up "Drag to re-order". This should open a new window with draggable thumbnails to allow you to re-order your gallery. Drag them around, and hit save to save the new order.

    This was written to use mootools or scriptaculous. This script and mootools won’t work with IE though (I’ve no idea why), so you’d probably better use scriptaculous unless you only use something other than IE to manage your gallery.

    Al
      • 16610
      • 634 Posts
      This sounds like a fantastic add-on smiley

      Very user friendly way to organize large photo collections.
        Mikko Lammi, Owner at Maagit
        • 7923
        • 4,213 Posts
        LOL, I just scratched this feature off from my todo list four days ago.. grin

        How would you feel about including this to the main snippet by default? It needs to be fixed for IE first, but I don’t think that’s a big issue. And what do other people think about it? Good or bad and why?

        And, What do you think about doing it with MooTools?


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 1294
          • 16 Posts
          Quote from: doze at Dec 29, 2006, 05:49 PM

          LOL, I just scratched this feature off from my todo list four days ago.. grin

          Aha, yeah... I thought I’d better do it myself in the end!! I’m also keen to see ’unzip’ support since my web hosting doesn’t have ZZiplib installed. Might have a look at that later.

          Yeah, if I can fix it for IE, it would be great to put in the release.

          I’ll rewrite this to use mootools. hadn’t seen that modx was going to use it for v1 until just now
            • 7923
            • 4,213 Posts
            Yea, MooTools would be better I think.. and btw, resources shouldn’t use the files under /manager folder.. Here’s an example on how to do a sortable list with MooTools (also see the update), seems to be quite simple (demo here)..

            What do you think about making the management view itself to be a sortable one and not in a new window? Or do you think it’s more usable if the sorting happens on a new window?

            About the zip thing, I have looked littlebit into that and it definitely needs changing, it’s a mess in maxigallery code anyways.. I’ve thought about starting to use PclZip to manage zip files. It seems to be working fairly well for users in Scotty’s resource wizard module.. What do you think about it?


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: doze at Dec 30, 2006, 11:12 AM

              About the zip thing, I have looked littlebit into that and it definitely needs changing, it’s a mess in maxigallery code anyways.. I’ve thought about starting to use PclZip to manage zip files. It seems to be working fairly well for users in Scotty’s resource wizard module.. What do you think about it?
              Just FYI, the PclZip library will likely be included in the new MODx core very soon, as part of upcoming installation and configuration management features.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Is using this library liable to cause conflicts with systems that have it configured in the PHP?

                I have this problem with a SOAP library I’m using; if my scripts load the third-party SOAP library and PHP is configured with SOAP, they conflict. So I have to have two version of the script, since most shared hosting installations don’t have SOAP included.

                Actually, I suppose that’s the fault of the library developer; I would think that one should take great care not to conflict with any default library’s namespace.
                  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
                  • 1294
                  • 16 Posts
                  What do you think about making the management view itself to be a sortable one and not in a new window? Or do you think it’s more usable if the sorting happens on a new window?
                  I thought it was better in a new window. That way you just have to drag some thumbnails around and the extra form fields don’t need to be displayed. It’s more compact like that.

                  I reckon I’ve fixed it for IE. I’ll post it soon, after I’ve made it work with mootools.

                  Good point about not calling scripts from the manager folder. I’ll change the code for that too.

                  Thinking about zips... Perhaps there could be a way of including a certain file in the zip with renaming info in? When the zip is uploaded. titles and descriptions could be filled in automatically. I did this on one of my other sites, and it made it much easier - you do the work offline, then just upload it.
                    • 7923
                    • 4,213 Posts
                    Quote from: sottwell at Dec 31, 2006, 01:58 AM

                    Is using this library liable to cause conflicts with systems that have it configured in the PHP?
                    Not sure, but I think that it won’t collide with ZZIPlib.. The first versions of PclZip used to use ZZIPlib for extracting zips and their own code for creating a zip, but the later versions have functionality to do the extracting too.. so I guess they have taken the possible namespace etc conflicts into consideration while developing it..

                    Quote from: al_b at Dec 31, 2006, 04:21 AM

                    What do you think about making the management view itself to be a sortable one and not in a new window? Or do you think it’s more usable if the sorting happens on a new window?
                    I thought it was better in a new window. That way you just have to drag some thumbnails around and the extra form fields don’t need to be displayed. It’s more compact like that.
                    Yeah.. could be.. leave it like that.. smiley

                    Quote from: al_b at Dec 31, 2006, 04:21 AM

                    Thinking about zips... Perhaps there could be a way of including a certain file in the zip with renaming info in? When the zip is uploaded. titles and descriptions could be filled in automatically. I did this on one of my other sites, and it made it much easier - you do the work offline, then just upload it.
                    Sounds good to me.. wink


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 1294
                      • 16 Posts
                      I’ve uploaded a new version of this script 0.2a. It allows users to edit a template to use either mootools or scriptaculous. IE doesn’t do anything when it’s set up for mootools. I’ve no idea why. It seems straightforward to me, and as usual FF is fine. Better use scriptaculous for now...

                      Doze: feel free to include this in the distro.