idea 代码格式化 谷歌_Google Docsmaklet格式化代码

news/2024/7/19 16:41:42 标签: javascript, php, js, java, python
idea 代码格式化 谷歌

idea 代码格式化 谷歌

Something has been annoying me for some time as I write this book in Google Docs: I want to be able to format text as code (Courier New) only using the keyboard. So I came up with this bookmarklet. It's one of those "works for me" so if it doesn't work for you feel free to modify and post here your version.

在Google Docs中编写本书时,有段时间让我感到烦恼:我希望仅使用键盘就能将文本设置为代码格式(Courier New)。 所以我想出了这个书签。 这是“为我工作”之一,因此,如果对您不起作用,请随时进行修改并在此处发布您的版本。

(Code)

Basically I attach an event (FF way, so won't work in IE) that listens to the keyboard combination ALT+x and then calls the appropriate editor command:

基本上,我附加了一个事件(FF方式,因此在IE中将无法使用),该事件监听键盘组合键ALT+x ,然后调用适当的编辑器命令:

javascript>javascript:(
function(){
  window.frames[1].document.addEventListener(
    'keypress',
    function(e){
      if (e.altKey && e.charCode === 120){
        EditorCommand('fontname', 'Courier New'); 
        return false;
      }
    },
    false);
}
)()

下载 (Download)

Right-click, bookmark:

右键单击,添加书签:

Alt+X

Alt + X

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/google-docs-bookmaklet-to-format-code/

idea 代码格式化 谷歌


http://www.niftyadmin.cn/n/1307037.html

相关文章

设计模式-工厂模式(简单工厂)

工厂模式 属于[创建型],分为简单工厂、工厂方法、抽象工厂。 1.简单工厂模式 针对接口编程,封装变化。 public class PizzaStore {// 预定一个pizzaPizza orderPizza(String type) {// new一个pizzaPizza pizza null;if ("cheese".equals(typ…

velocity_Velocity在线会议2011年3月

velocityVery rough notes from the event that just ended a few minutes ago 几分钟前结束的活动中的非常粗糙的注释 1 1 Tony Gentilcore (google) and Anderson Quach (MSFT) talked about the W3C working group and the specs for measuring performance: Tony Genti…

设计模式-工厂模式(工厂方法)

工厂方法模式让类把实例化推迟到子类 假设披萨店要开一个分店,加盟店需要提供不同风味的比萨。 一种做法是写出几种不同的工厂: factory new SimplePizzaFactory(); PizzaStore pizzaStore new PizzaStore(factory); pizzaStore.orderPizza("ch…

FusionCharts封装-Category

Categories.java: /*** Title:Categories.java* Package:com.fusionchart.model* Description:FusionCharts 封装Category* author:Youhaidong(游海东)* date:2014-1-22 下午9:52:28* version V1.0*/ package com.fusionchart.model;import java.io.Serializable; i…

hg19索引文件_hg从存储库还原单个文件

hg19索引文件还原(Revert) hg revert -r .^ filename提交中有什么内容? (Whats in a commit?) hg tip -vp忘记这些未跟踪的文件 (Forget these untracked files) hg purgeTell your friends about this post on Facebook and Twitter 在Facebook和Twitter上告诉您…

bat替换脚本_用脚本替换“主页”按钮

bat替换脚本Robert Ames commented on my previous post suggesting replacing the Home button with my little site search bookmarklet. I didnt even know this was possible, but I found it pretty cool, so I just had to try. 罗伯特艾姆斯( Robert Ames )在我的上一篇…

设计模式-工厂模式(抽象工厂模式)

抽象工厂模式 抽象工厂模式:提供一个接口,用于创建相关或依赖对象的家族,而不需要明确指定具体类。 简单工厂 工厂方法 假设我们需要同时生产本地和纽约的芝士披萨,如下: public interface MixPizzaFactory {Pizza c…

FusionCharts封装-Data

DataSet.java: /*** Title:DataSet.java* Package:com.fusionchart.model* Description:FusionCharts 封装data* author:Youhaidong(游海东)* date:2014-1-22 下午10:01:58* version V1.0*/ package com.fusionchart.model;import java.io.Serializable; import jav…