We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36805
    • 354 Posts
    Quote from: Lammikko at Feb 05, 2011, 02:58 AM

    Quote from: sharkbait at Feb 04, 2011, 12:49 PM

    why does/would QM need to load jQuery in the manager? "Load jQuery in manager - true/false"
    QM+ needs jQuery to work. I you are not using e.g. ManagerManager plugin that already loads jQuery you have to load jQuery for QM+.
    I got confused by this too and I would find it interesting to know. I know QM+ needs JQuery and why. However I always thought of it as a pure frontend tool (unlike ManagerManager, which runs in front and backend). Could it be that the inner workings of QM+ require it to be loaded in the manager somehow?
      • 20413
      • 2,877 Posts
      QM presents you the core manager in an iframe loaded on the top of the front-end.
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 26931
        • 2,314 Posts
        QM presents you the core manager in an iframe loaded on the top of the front-end.
        yes, question was, why it needs jQuery for the manager smiley
          • 20413
          • 2,877 Posts
          Quote from: sharkbait at Feb 06, 2011, 11:37 PM

          QM presents you the core manager in an iframe loaded on the top of the front-end.
          yes, question was, why it needs jQuery for the manager smiley

          Why QM is built on jQuery!?
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Why not? I wish the whole Manager was built on JQuery.
              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
              • 20413
              • 2,877 Posts
              Quote from: sottwell at Feb 07, 2011, 02:51 AM

              Why not? I wish the whole Manager was built on JQuery.

              +1
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • 36805
                • 354 Posts
                Quote from: sharkbait at Feb 06, 2011, 11:37 PM

                QM presents you the core manager in an iframe loaded on the top of the front-end.
                yes, question was, why it needs jQuery for the manager smiley
                I suppose for example some of the inline button features require it, like set a template a la
                <!-- qm-new [*id*] 9 ’Add Article’ -->
                It then needs to alter the option value of the template select field inside the iframe with the DocForm.

                I didn’t realize the manager is loaded in an iframe which is why it has to be included there too, unless already done by ManagerManager. (thx MrHaw, its starting to make sense now)
                  • 26931
                  • 2,314 Posts
                  yeah smiley thank you both & Lammiko
                    • 16610
                    • 634 Posts
                    QM+ needs jQuery also in manager iframe (while editing the resource). Why?

                    - Simplified buttons, only save and cancel (other buttons would cause problems)
                    - Hide parent option (unusable without site tree)
                    - Possibility to hide other fields and tabs, check QM+ docs & config for more details
                      Mikko Lammi, Owner at Maagit
                      • 31178
                      • 128 Posts
                      I’ve just been testing out Modx 1.0.5 and the current QM.

                      I have another suggestion for you Mikko ;-)

                      When modifiying the resource content as a richtext field (TinyMCE) and then cancelling it brings up a ’Are you sure you want to navigate away...’ message from the TinyMCE autosave feature. But this is too late as the window is already closing. Also a modified standard text field change is not trapped due to the documentDirty=false statement in the cancel button.

                      I worked around these issues by checking the TinyMCE dirty status in the onclick javascript. Thus the save and cancel buttons at around line 700ish of qm.inc.php could become:

                      // Add action buttons --- uxello fix nav away messages
                      $mc->addLine('var controls = "<div style=\"padding:4px 0;position:fixed;top:10px;right:-10px;z-index:1000\" id=\"qmcontrols\" class=\"actionButtons\"><ul><li><a href=\"#\" onclick=\"documentDirty=false;document.mutate.save.click();return false;\"><img src=\"media/style/'.$qm_theme.'/images/icons/save.png\" />'.$_lang['save'].'</a></li><li><a href=\"#\"  onclick=\"	alertcancel=documentDirty; 	 if (typeof(tinyMCE)!==\'undefined\') {var i, t = tinyMCE.editors;for (i in t){    if (t.hasOwnProperty(i)){        if (t[i].isDirty() ) alertcancel =true; }}}   continuecancel=true;				if (alertcancel) {continuecancel = confirm(\'Document has been modified. Continue cancel (changes will be lost)?\');} if (continuecancel) {  documentDirty=false;         if (typeof(tinyMCE)!==\'undefined\') {   var i, t = tinyMCE.editors;for (i in t){    if (t.hasOwnProperty(i)){    t[i].isNotDirty=true }}  }                        parent.'.$jq_mode.'.fn.colorbox.close();}  return false;\"><img src=\"media/style/'.$qm_theme.'/images/icons/stop.png\"/>'.$_lang['cancel'].'</a></li></ul></div>";');
                      


                      The code is a bit of a mess at the moment but it works ok for one TinyMCE editor in the resource. I have not figured out how to account for having a richtext TV. If you change the text in another TinyMCE instance then switch to one that has not been altered and cancel then it does not work... also no language config for the confirm so only 90% there.
                      Of course if you are not using TinyMCE as the rich text editor it does not help!

                      UPDATE: Now got it working for multiple TinyMCE instances.