我无法阅读 Google 日历活动的完整标题,因为它们被截断以适合日期框。因此,打印输出并没有想象中那么有用。
曾经有一个greasemonkey插件改变了CSS来解决这个问题,但谷歌重新设计了日历,现在标题相互重叠,无法正确阅读。
我现在需要向页面添加哪些 CSS 才能使事件标题更好地换行?这是 Greasemonkey 插件的现有代码:
function buildStyle()
{
var st = "div.rb-n, span, nobr { white-space: normal; }";
var dochead = document.getElementsByTagName("head")[0];
var stEl = document.createElement("style");
stEl.setAttribute("type", "text/css");
stEl.innerHTML = st;
dochead.appendChild(stEl);
}
window.addEventListener("load", function(e) {
buildStyle();
}, false);
这是 Greasemonkey 插件本身:http://userscripts.org/scripts/show/97755 http://userscripts.org/scripts/show/97755-- 如果您将 Google 日历恢复为“经典视图”,则可以看到它可以正常工作,但无法在新视图中工作。
UPDATE:
我保存了一个 Google 日历的示例,其中显示了两个测试事件:
-
http://pastebin.com/wx5Qm8yx http://pastebin.com/wx5Qm8yx- 日历的 HTML 代码
-
http://pastebin.com/UZnLp2Pj http://pastebin.com/UZnLp2Pj- 现有样式表,将其重命名为 style.css
根据提供的页面示例,您将使用以下样式:
.rb-n {
white-space: normal !important;
}
.te {
overflow: inherit !important;
white-space: normal !important;
}
Note:
-
如果您只是改变样式,那么它比使用要优越得多Stylish https://addons.mozilla.org/en-US/thunderbird/addon/stylish/.
时尚更快;页面更改更容易/更快地维护;更改不会出现任何闪烁或延迟;通常,有人已经在以下位置发布了您想要的大部分内容Userstyles.org http://userstyles.org/.
-
同样,您不需要使用所有 JS 在 Greasemonkey 中添加样式。使用GM_addStyle http://wiki.greasespot.net/GM_addStyle功能:
GM_addStyle ( " \
.rb-n { \
white-space: normal !important; \
} \
.te { \
overflow: inherit !important; \
white-space: normal !important; \
} \
" );
谷歌会在没有任何警告的情况下迅速更改其页面。Firebug http://getfirebug.com/wiki/index.php/Main_Page可以帮助确定出现的新更改和 CSS 解决方法。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)