[Box] Show Tag at sidebar

try to take over the world!

  1. // ==UserScript==
  2. // @name [Box] Show Tag at sidebar
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4.2
  5. // @description try to take over the world!
  6. // @author SSARCandy
  7. // @match https://app.box.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13. let cache_tags = '';
  14.  
  15. $( document ).ajaxComplete(function( event, xhr, settings ) {
  16. if (xhr.responseText.match('popup-heading')) {
  17. setTimeout(()=> {
  18. const html = `<span class="item-tags" style="white-space: pre-wrap;">${cache_tags.map(t => `<span class="auto-fill item-tag">${t}</span>`).join(' ')}</span>`;
  19. $('.tags-autocomplete').append(html);
  20. $('.auto-fill').click(function() {
  21. $('textarea.pill-selector-input').val( $(this).text() ).keyup();
  22. return false;
  23. });
  24. }, 200);
  25. //console.log(html)
  26. }
  27. });
  28.  
  29. $.ajax({
  30. url: "https://app.box.com/index.php?rm=box_tag_get_tags",
  31. }).done(function (res) {
  32. let tags = res.nodes;
  33. cache_tags = Object.keys(tags).map((key, index) => tags[key].name);
  34.  
  35. const html =
  36. `<ul><li class="tags tag_container last-child" id="tag-cloud">
  37. ${cache_tags.map(t => `<span class="badge upgrade mrs" style="margin-bottom: 5px;"><a href="/folder/0/search?tags=${t.replace('#', '%23')}&view=list" id="t_${t}" class="tag_name" data-type="tag-btn">${t}</a></span>`).join(' ')}
  38. </li></ul>`;
  39. $('#left-nav').append(html);
  40.  
  41. });
  42.  
  43. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址