Review main Merged

43965[BUGFIX] Fix usage of TYPO3.Storage JS and Tabs.js

Markus Klein CR +2 V +2 Normal +65 −59 updated 10/12/15, 14:10

Commit message

The Storage module must be required as dependency in modules as usual.
The module itself has to take care whether a global object
is already present. If this is the case, the global object is used.

Additionally the Tabs.js is fixed to work again.

Review

  • Code review CR +2
    • Frank Nägler +2
    • Wouter Wolters +1
    • Frans Saris +1
  • Verified V +2
    • Frank Nägler +2
    • Wouter Wolters +1

Issues 1

Files 5

Review log 25

  1. Markus Klein uploaded patch set 1 10/10/15, 14:08

  2. Andreas Kienast voted on patch set 1 CR +1 10/10/15, 14:10

  3. Andreas Kienast voted on patch set 1 V +1 10/10/15, 14:12

  4. Andreas Allacher commented on patch set 1 10/10/15, 14:24

    What if I load the module in another tab and therefore there is not top frame?
  5. Frans Saris commented on patch set 1 10/10/15, 16:06

    Shouldn't the Storage module take care of the location where data is stored? So you just require the StorageModule and the internals of the StorageModule make sure top is accessed
  6. Markus Klein commented on patch set 1 10/11/15, 21:04

    @Frans: That would be even more awesome!
  7. Andreas Allacher commented on patch set 1 10/11/15, 21:07

    That sounds acutally really good. It might also solve some other issues, e.g. there is a IE11 bug that sometimes happens with trees because the top.TYPO3.storage seems to have been "lost" :)
  8. Markus Klein uploaded patch set 2 10/11/15, 22:51

  9. Markus Klein updated the commit message in patch set 3 10/11/15, 22:53

  10. Wouter Wolters voted on patch set 3 V +1 CR +1 10/12/15, 06:37

  11. Frans Saris commented on patch set 3 10/12/15, 08:38

    Storage.js:35

    is TYPO3.Storage per definition always loaded on top/parent?
  12. Markus Klein commented on patch set 3 10/12/15, 09:04

    Storage.js:35 Reply

    Yes. See also at the very bottom.
  13. Markus Klein uploaded patch set 4 10/12/15, 10:22

  14. Frans Saris commented on patch set 3 10/12/15, 10:37

    Storage.js:35 Reply

    ah, I was thinking about a require call to this module on top level but that is indeed not needed.
  15. Frans Saris commented on patch set 4 10/12/15, 10:37

    Storage.js:193

    why did you drop the top. ?
  16. Frank Nägler commented on patch set 4 10/12/15, 12:39

    Tabs.js:19

    single quotes please

    SystemInformationMenu.js:18

    single quotes please

    Main.js:17

    single quotes please

    Main.js:124

    maybe put the selector in class property?
  17. Frank Nägler commented on patch set 4 10/12/15, 12:59

    Storage.js:193 Reply

    imo not needed anymore, any concerns?
  18. Frank Nägler uploaded patch set 5 10/12/15, 13:02

  19. Frank Nägler voted on patch set 5 CR +1 V +1 10/12/15, 13:03

  20. Wouter Wolters voted on patch set 5 V +1 CR +1 10/12/15, 13:09

  21. Frank Nägler commented on patch set 5 CR -2 10/12/15, 13:18

    Frans concerns should be discusses with Markus
  22. Frans Saris commented on patch set 5 10/12/15, 13:29

    I get the idea of having only 1 storage for your current "window" but this ideally should also somehow communicate with a 2th tab that gets opened. Further are the persisted settings pushed to the storage on every frame (re)load. By the requireJs callback setup in the BackupController // load the storage API and fill the UC into the PersistentStorage, so no additional AJAX call is needed $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage', 'function(Storage) { Storage.Persistent.load(' . json_encode($this->getBackendUser()->uc) . '); }'); Not sure if that is 100% by intension. If so then fine :) IMO it would be cleaner to not always load Storage.js. But when required walk up through the windows (top.) until we find the highest top.TYPO3 and when available use top.TYPO3.Storage. Else create top.TYPO3.Storage and load the settings over Ajax. Then you can use Storage.js in your own stuff without defining the callback in the upper most window.
  23. Frans Saris commented on patch set 5 CR +1 10/12/15, 13:51

    We will tackle the loading of the preferences on demand when needed in a different patch. Let's get this in :)
  24. Frank Nägler voted on patch set 5 CR +2 V +2 10/12/15, 14:10

  25. Frank Nägler merged patch set 5 10/12/15, 14:10