No edit summary
Tag: Reverted
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
/* All JavaScript here will be loaded for users of the mobile site */
mw.loader.using('mobile.site.styles')
/* Note, there is no corresponding User:Username/mobile.js; however users may use User:Username/minerva.js */
 
function addPortletLink() {
var timer = setInterval(function() {
  mw.log.warn('addPortletLink is deprecated on desktop and never implemented on mobile', 'More information on https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#addPortletLink');
      if ($('.menu ul:first').length) {
}
          console.log("mobile menu exists");
          clearInterval(timer);
          $('.menu ul:first').after(
                '<ul class="level1"> \
                      <li> \
                      <a href="#" \
                            class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"> \
                      <span>Contribute</span> \
                      </a> \
                      </li> \
                      <ul class ="level2"> \
                          <li> \
                          <a href="/wiki/Bharatpedia:Help" \
                                class="mw-ui-icon mw-ui-icon-before"> \
                          <span>Help</span> \
                          </a> \
                          </li> \
                          <li> \
                          <a href="/wiki/Link_2" \
                                class="mw-ui-icon mw-ui-icon-before"> \
                          <span>Contribute</span> \
                          </a> \
                          </li> \
                          <li> \
                          <a href="/wiki/Link_3" \
                                class="mw-ui-icon mw-ui-icon-before"> \
                          <span>Community portal</span> \
                          </a> \
                          </li> \
                          <a href="/wiki/Link_2" \
                                class="mw-ui-icon mw-ui-icon-before"> \
                          <span>Create article</span> \
                          </a> \
                          </li> \
                          <li> \
                          <a href="/wiki/Link_2" \
                                class="mw-ui-icon mw-ui-icon-before"> \
                          <span>Upload file</span> \
                          </a> \
                          </li> \
                          <li> \
                        </ul> \
                </ul> \
                <ul> \
                      <li> \
                      <a href="/wiki/Bharatpedia:Donate" \
                            class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"> \
                      <span>Donate</span> \
                      </a> \
                      </li> \
                </ul>'
            );
            $(".menu").find(".level2").hide(); // hide level2 until level1 is clicked
            $(".level1").click(function(event){
                $(this).find(".level2").slideToggle(500);
            }); // if level1 is clicked, dropdown level2
      }
  }, 100); // check every 100ms

Latest revision as of 00:04, 25 November 2022

/* All JavaScript here will be loaded for users of the mobile site */
/* Note, there is no corresponding User:Username/mobile.js; however users may use User:Username/minerva.js */
function  addPortletLink() {
  mw.log.warn('addPortletLink is deprecated on desktop and never implemented on mobile', 'More information on https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#addPortletLink');
}