Actions

Developer Area/MochiKit in Mahara: Difference between revisions

From Mahara Wiki

< Developer Area
No edit summary
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
MochiKit needs to be removed from Mahara since it's unmaintained and unnecessary alongside jQuery (https://bugs.launchpad.net/mahara/+bug/1323920). This page lists the places it's still used, grouped by function to (hopefully) make it easier to refactor nicely.
MochiKit needs to be removed from Mahara since it's unmaintained and unnecessary alongside jQuery (https://bugs.launchpad.net/mahara/+bug/1323920). This page lists the places it is still used, both as a basic list and grouped by function to (hopefully) make it easier to refactor nicely.


== Similar components/snippets ==
The list, for the most part, has been automatically generated by [https://github.com/binary-koan/state-of-mahara this tool], which detects Mochikit function names. It has been manually reviewed for false positives, and other Mochikit patterns that the tool does not detect such as $() have been added manually.
 
== MochiKit in PHP files ==
 
Picked up via automated tool:
Picked up via automated tool:
* <s>account/index.php</s>
* <s>admin/groups/archives.php</s>
* <s>admin/groups/groupcategories.php</s>
* <s>admin/groups/groups.php</s>
* <s>admin/site/fonts.php</s>
* <s>admin/site/menu.php</s>
* <s>admin/site/views.php</s>
* <s>admin/statistics.php</s>
* <s>admin/upgrade.php</s>
* <s>admin/users/addauthority.php</s>
* <s>admin/users/institutionadmins.php</s>
* admin/users/institutionpages.php
* <s>admin/users/institutions.php</s>
* <s>admin/users/institutionstaff.php</s>
* <s>admin/users/institutionusers.php</s>
* <s>admin/users/pendingregistrations.php</s>
* <s>admin/users/progressbar.php</s>
* <s>admin/users/search.php</s>
* <s>admin/users/statistics.php</s>
* <s>admin/users/suspended.php</s>
* <s>artefact/annotation/lib.php</s>
* <s>artefact/blog/index.php</s>
* <s>artefact/blog/view/index.php</s>
* <s>artefact/file/profileicons.php</s>
* <s>artefact/internal/blocktype/textbox/lib.php</s>
* <s>artefact/resume/lib.php</s>
* <s>auth/lib.php</s>
* <s>blocktype/creativecommons/lib.php</s>
* <s>blocktype/wall/lib.php</s>
* <s>group/members.php</s>
* <s>group/topics.php</s>
* <s>group/view.php</s>
* <s>index.php</s>
* <s>interaction/forum/lib.php</s>
* <s>lib/form/elements/artefactchooser.php</s>
* <s>lib/form/elements/checkboxes.php</s>
* <s>lib/form/elements/filebrowser.php</s>
* <s>lib/form/renderers/maharatable.php</s>
* <s>lib/institution.php</s>
* <s>module/multirecipientnotification/inbox.php</s>
* <s>module/multirecipientnotification/outbox.php</s>
* <s>tags.php</s>
* <s>user/find.php</s>
* <s>user/myfriends.php</s>
* <s>user/view.php</s>
* <s>view/access.php</s>
* <s>view/blocks.php</s>
* <s>view/choosetemplate.php</s>
* <s>view/groupviews.php</s>
* <s>view/index.php</s>
* <s>view/institutionviews.php</s>
* <s>view/sharedviews.php</s>
* <s>view/view.php</s>
* <s>search/elasticsearch/index.php</s>
 
Picked up manually:
 
* <s>admin/extensions/plugins.php</s>
* <s>lib/form/elements/color.php</s>
* <s>lib/form/elements/wysiwyg.php</s>
* <s>lib/pieforms/pieform/elements/date.php</s>
* <s>lib/pieforms/pieform/elements/expiry.php</s>
* <s>lib/pieforms/pieform/elements/select.php</s>
* <s>lib/pieforms/pieform/elements/textarea.php</s>
* <s>selfsearch.php</s>
* <s>theme/raw/templates/form/autocomplete.tpl</s>
* <s>theme/raw/templates/form/emaillist.tpl</s>
* <s>theme/raw/templates/form/files.tpl</s>
* <s>theme/raw/templates/form/multitext.tpl</s>
* <s>theme/raw/templates/form/userlist.tpl</s>
* <s>theme/raw/templates/sideblocks/progressbar.tpl</s>
* <s>theme/raw/templates/view/retractablejs.tpl</s>
* <s>theme/raw/plugintype/artefact/blog/templates/blog.tpl</s>
* <s>theme/raw/plugintype/artefact/blog/templates/view.tpl</s>
* <s>theme/raw/plugintype/artefact/plans/blocktype/plans/templates/content.tpl</s>
* <s>theme/raw/plugintype/artefact/blocktype/groupviews/templates/groupviews.tpl</s>
* <s>theme/raw/plugintype/artefact/myfriends/templates/myfriends.tpl</s>
* <s>theme/raw/plugintype/artefact/mygroups/templates/mygroups.tpl</s>
* <s>theme/raw/plugintype/artefact/myviews/templates/myviews.tpl</s>
* <s>theme/raw/plugintype/artefact/watchlist/templates/watchlist.tpl</s>
 
== MochiKit in JS files ==
 
Picked up via automated tool:
* artefact/blog/blocktype/taggedposts/js/taggedposts.js
* artefact/file/js/filebrowser.js
* artefact/plans/blocktype/plans/js/plansblock.js
* blocktype/creativecommons/js/creativecommons.js
* blocktype/openbadgedisplayer/js/configform.js
* <s>js/adminadduser.js</s>
* <s>js/adminexportqueue.js</s>
* <s>js/adminsiteoptions.js</s>
* <s>js/adminsitepages.js</s>
* <s>js/adminuploadcsv.js</s>
* <s>js/adminusersearch.js</s>
* js/export.js
* <s>js/keyboardNavigation.js</s>
* js/mahara.js
* <s>js/paginator.js </s>
* js/searchtable.js
* js/tablerenderer.js
* js/viewmenu.js
* js/views.js
* lib/pieforms/static/core/elements/textarea.js
* lib/pieforms/static/core/pieforms.js
 
Picked up manually:
* artefact/annotation/blocktype/annotation/js/annotation.js
 
== Custom MochiKit modules ==
 
* js/Pager.js - only used in /htdocs/js/tablerenderer.js. /htdocs/js/paginator.js is an alternate pagination method.
 
== Grouped into similar components/snippets ==


* Editable list (admin/groups/groupcategories.php, admin/site/menu.php)
* Editable list (admin/groups/groupcategories.php, admin/site/menu.php)
Line 12: Line 131:
** user/find.php
** user/find.php
** user/myfriends.php
** user/myfriends.php
== JS in PHP (MochiKit usage only; there's also a lot of jQuery) ==
* Reloading the page on select box change (bad for accessibility!)
* Reloading the page on select box change (bad for accessibility!)
** admin/users/institutionusers.php
** admin/users/institutionusers.php
Line 38: Line 154:
* Login form JS (auth/lib.php:get_login_form_js)
* Login form JS (auth/lib.php:get_login_form_js)
* Adding wall posts (blocktype/wall/lib.php)
* Adding wall posts (blocktype/wall/lib.php)
* Hide homepage info boxes (index.php)
* Tags page (tags.php)
* Choose view template (view/choosetemplate.php)
== MochiKit in JS files ==
* artefact/blog/blocktype/taggedposts/js/taggedposts.js
* artefact/file/js/filebrowser.js
* artefact/plans/blocktype/plans/js/plansblock.js
* blocktype/creativecommons/js/creativecommons.js
* blocktype/openbadgedisplayer/js/configform.js
* js/adminadduser.js
* js/adminexportqueue.js
* js/adminsiteoptions.js
* js/adminsitepages.js
* js/adminuploadcsv.js
* js/adminusersearch.js
* js/export.js
* js/keyboardNavigation.js
* js/mahara.js
* js/paginator.js
* js/searchtable.js
* js/tablerenderer.js
* js/viewmenu.js
* js/views.js (getViewportDimensions)
* lib/pieforms/static/core/elements/textarea.js
* lib/pieforms/static/core/pieforms.js
== MochiKit modules ==
* js/MochiKit/*
* js/Pager.js

Latest revision as of 11:12, 28 February 2017

MochiKit needs to be removed from Mahara since it's unmaintained and unnecessary alongside jQuery (https://bugs.launchpad.net/mahara/+bug/1323920). This page lists the places it is still used, both as a basic list and grouped by function to (hopefully) make it easier to refactor nicely.

The list, for the most part, has been automatically generated by this tool, which detects Mochikit function names. It has been manually reviewed for false positives, and other Mochikit patterns that the tool does not detect such as $() have been added manually.

MochiKit in PHP files

Picked up via automated tool: Picked up via automated tool:

  • account/index.php
  • admin/groups/archives.php
  • admin/groups/groupcategories.php
  • admin/groups/groups.php
  • admin/site/fonts.php
  • admin/site/menu.php
  • admin/site/views.php
  • admin/statistics.php
  • admin/upgrade.php
  • admin/users/addauthority.php
  • admin/users/institutionadmins.php
  • admin/users/institutionpages.php
  • admin/users/institutions.php
  • admin/users/institutionstaff.php
  • admin/users/institutionusers.php
  • admin/users/pendingregistrations.php
  • admin/users/progressbar.php
  • admin/users/search.php
  • admin/users/statistics.php
  • admin/users/suspended.php
  • artefact/annotation/lib.php
  • artefact/blog/index.php
  • artefact/blog/view/index.php
  • artefact/file/profileicons.php
  • artefact/internal/blocktype/textbox/lib.php
  • artefact/resume/lib.php
  • auth/lib.php
  • blocktype/creativecommons/lib.php
  • blocktype/wall/lib.php
  • group/members.php
  • group/topics.php
  • group/view.php
  • index.php
  • interaction/forum/lib.php
  • lib/form/elements/artefactchooser.php
  • lib/form/elements/checkboxes.php
  • lib/form/elements/filebrowser.php
  • lib/form/renderers/maharatable.php
  • lib/institution.php
  • module/multirecipientnotification/inbox.php
  • module/multirecipientnotification/outbox.php
  • tags.php
  • user/find.php
  • user/myfriends.php
  • user/view.php
  • view/access.php
  • view/blocks.php
  • view/choosetemplate.php
  • view/groupviews.php
  • view/index.php
  • view/institutionviews.php
  • view/sharedviews.php
  • view/view.php
  • search/elasticsearch/index.php

Picked up manually:

  • admin/extensions/plugins.php
  • lib/form/elements/color.php
  • lib/form/elements/wysiwyg.php
  • lib/pieforms/pieform/elements/date.php
  • lib/pieforms/pieform/elements/expiry.php
  • lib/pieforms/pieform/elements/select.php
  • lib/pieforms/pieform/elements/textarea.php
  • selfsearch.php
  • theme/raw/templates/form/autocomplete.tpl
  • theme/raw/templates/form/emaillist.tpl
  • theme/raw/templates/form/files.tpl
  • theme/raw/templates/form/multitext.tpl
  • theme/raw/templates/form/userlist.tpl
  • theme/raw/templates/sideblocks/progressbar.tpl
  • theme/raw/templates/view/retractablejs.tpl
  • theme/raw/plugintype/artefact/blog/templates/blog.tpl
  • theme/raw/plugintype/artefact/blog/templates/view.tpl
  • theme/raw/plugintype/artefact/plans/blocktype/plans/templates/content.tpl
  • theme/raw/plugintype/artefact/blocktype/groupviews/templates/groupviews.tpl
  • theme/raw/plugintype/artefact/myfriends/templates/myfriends.tpl
  • theme/raw/plugintype/artefact/mygroups/templates/mygroups.tpl
  • theme/raw/plugintype/artefact/myviews/templates/myviews.tpl
  • theme/raw/plugintype/artefact/watchlist/templates/watchlist.tpl

MochiKit in JS files

Picked up via automated tool:

  • artefact/blog/blocktype/taggedposts/js/taggedposts.js
  • artefact/file/js/filebrowser.js
  • artefact/plans/blocktype/plans/js/plansblock.js
  • blocktype/creativecommons/js/creativecommons.js
  • blocktype/openbadgedisplayer/js/configform.js
  • js/adminadduser.js
  • js/adminexportqueue.js
  • js/adminsiteoptions.js
  • js/adminsitepages.js
  • js/adminuploadcsv.js
  • js/adminusersearch.js
  • js/export.js
  • js/keyboardNavigation.js
  • js/mahara.js
  • js/paginator.js
  • js/searchtable.js
  • js/tablerenderer.js
  • js/viewmenu.js
  • js/views.js
  • lib/pieforms/static/core/elements/textarea.js
  • lib/pieforms/static/core/pieforms.js

Picked up manually:

  • artefact/annotation/blocktype/annotation/js/annotation.js

Custom MochiKit modules

  • js/Pager.js - only used in /htdocs/js/tablerenderer.js. /htdocs/js/paginator.js is an alternate pagination method.

Grouped into similar components/snippets

  • Editable list (admin/groups/groupcategories.php, admin/site/menu.php)
  • User search (js/adminexportqueue.js, js/adminusersearch.js)
  • Connecting pagination to search box
    • admin/groups/groups.php
    • admin/users/institutions.php
    • group/members.php
    • search/elasticsearch/index.php
    • user/find.php
    • user/myfriends.php
  • Reloading the page on select box change (bad for accessibility!)
    • admin/users/institutionusers.php
    • admin/users/pendingregistrations.php
    • admin/users/progressbar.php
    • admin/users/statistics.php
    • lib/institution.php
  • Focus element on load
    • admin/site/fonts.php
    • admin/site/views.php
    • view/groupviews.php
    • view/institutionviews.php
  • Form element hiding/showing
    • admin/users/addauthority.php - SSO and auth login message
    • admin/users/institutions.php - institution theme settings
    • view/access.php
  • Pagination initialization (artefact/blog/index.php, probably others)
  • Showing/hiding content of an expander (artefact/resume/lib.php:get_showhide_composite_js)
  • Blocktype inlinejs initialization (group/view.php, user/view.php, view/blocks.php, view/view.php)
  • Pieforms elements (lib/form/elements/{artefactchooser,checkboxes,filebrowser}.php)
  • Show upgrade progress (admin/upgrade.php)
  • Changing blog post status (artefact/blog/view/index.php)
  • Login form JS (auth/lib.php:get_login_form_js)
  • Adding wall posts (blocktype/wall/lib.php)