Widen Code Container (GitHub)

Adds a button to allow you to widen the container when viewing files

当前为 2015-12-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Widen Code Container (GitHub)
  3. // @namespace chriskim06
  4. // @description Adds a button to allow you to widen the container when viewing files
  5. // @include https://github.com/*
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  7. // @version 1.2
  8. // @grant none
  9. // @locale en
  10. // ==/UserScript==
  11.  
  12. this.$ = this.jQuery = jQuery.noConflict(true);
  13.  
  14. $(function() {
  15. if ($('#user-links').length) {
  16. $('#user-links').prepend('<li class="header-nav-item"><a href="javascript:void(0)" id="code-widen-button" class="header-nav-link notification-indicator" onclick="return false;"><span class="octicon octicon-mirror "></span></a></li>');
  17. $('#code-widen-button').click(function(e) {
  18. e.preventDefault();
  19. if ($('.repository-content').length) {
  20. var expanded = $(window).width() * 0.75;
  21. if ($('.repository-content').width() < expanded) {
  22. $('.repository-content').css('width', expanded + 'px');
  23. } else {
  24. $('.repository-content').css('width', '980px');
  25. }
  26. }
  27. });
  28. }
  29. });

QingJ © 2025

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