整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:

4个隐藏的设置让你更好地体验安卓版谷歌浏览器

4个隐藏的设置让你更好地体验安卓版谷歌浏览器

一个企业级的人 都置顶了 中国软件网

中国软件网 为你带来最新鲜的行业干货

编译│周润智

谷歌的安卓版Chrome浏览器提供了一个值得赞美的浏览体验,但是如果你知道如何解锁这些更多的功能,Chrome会变得更加高效。

你的手机浏览器是你通向网站的途径。在做重要的工作相关的研究时,你会想要尽可能的高效率。下面的这四个设置都是关于如何提高你的工作效率的。

1.一个让你的地址栏节省时间的小技巧

你大概已经知道在安卓版Chrome浏览器中,你可以立即从地址栏中得到不管是问题还是概念的答案。Chrome浏览器提供了另外一个有用的地址栏使用技巧。如果你像我一样,这会是一个十分便捷的捷径。每次你要从其他地方复制一个URL 到浏览器的时候,你必须要粘贴到你的浏览器中。如果你使用了这个便捷的功能,Chrome浏览器会自动将剪贴板的任何地址呈现到你面前。

要使用这个功能,你首先需要使用Chrome的Beta测试版本。打开应用,在地址栏中输入"chrome://flags"。然后点击在屏幕右上方的三点菜单按钮,选择"Find in page",在文本框内输入"clipboard"。之后,一个叫做"Omnibox clipboard URL suggestions."的页面就会立即弹跳出来。在选项框中将”Default”改为”Enabled”。最后,浏览器会提示你重启浏览器以启动应用,设置就完成了。

2.使手机网页更适合眼睛阅读

在手机上阅读通常不是一个令人愉快的体验。杂乱的页面,不一致的字体等等都影响了我们的注意力。下一次遇到这样杂乱的页面,试试Chrome清扫页面的隐形工具——阅读模式。

这种模式清除了所有超链接元素,比如说按钮,链接甚至是广告,并且将文章统一成了标准风格的格式。

要激活这个选项,先打开应用,在地址栏中输入"chrome://flags"。然后点击在屏幕右上方的三点菜单按钮,选择"Find in page",在文本框内输入“reader”。你会看到一个“Reader Mode triggering”,点击下面的选项,选择"With article structured markup." 就设定好了。

3 随心所欲地放大缩小页面

当我在看一个手机版网页的时候,禁止缩放这一点让我很抓狂。幸运的是,Chrome浏览器能够让你自由操控缩放。 打开浏览器的主设置,然后点击"Accessibility" ,最后选择"Force enable zoom."的选项就设置完成了。

4.将你的加载时间转换到超速挡

每个人都希望网页能够更加快速地加载, Chorme浏览器有一个选项可以满足人们的需求。

这个服务叫做Data Saver。它能在加载时轻微地压缩和优化内容,这样,网页加载的速度就会加快,数据的使用也会降低。

要进行这样的设置,点击Chrome的设置,找到"Data Saver"的选项。点击它,然后窗口上方的按钮开启它。

你已经解锁了一些谷歌Chrome最有意思的隐藏设置,相信你的手机浏览体验会比以前更加的舒适完美。

「原文连接」

http://www.computerworld.com/article/2474114/android/android-4-hidden-settings-to-make-chrome-for-android-even-better.html?idg_eid=98f7c462af288a3ed31af16ab852f1ea&email_SHA1_lc=a890e8105d99a940f507a3bcd1a937c7882f8ca6&cid=cw_nlt_computerworld_enterprise_apps_2017-06-13&utm_source=Sailthru&utm_medium=email&utm_campaign=Computerworld%20Enterprise%20Apps%202017-06-13&utm_term=computerworld_enterprise_apps

们常说,“你永远不知道,明天和意外哪个先到来”。这个世界本就充满危险,有的人前一刻还在河水中自在地游泳,下一刻可能就被一股暗流卷走。但这并不意味着我们要生活在担惊受怕之中。相反,我们应该注意学习安全知识,做好防范,规避风险。

TikTok用户Knowledgesaurus一直致力于安全知识科普,他制作了“可以救命的事实”系列视频,其中提到了面对地震、海啸、失温等不同危险情况的求生方法,视频点击量超过百万。一起来看看他的求生法则吧。

[Photo/Agencies]

If you ever find yourself buried in rubble and can't get out, don't yell. You'll end up just wasting energy and losing your voice. What you should do is grab something and start tapping in intervals of three. Humans are great at noticing patterns and the rescuers will start to move towards that. Once you hear them, then you can start yelling.如果你发现自己被埋在瓦砾中出不来,不要大喊大叫。这样最终只会让你的精力耗尽,发不出声来。你应该做的是抓住某样东西,三次一间隔的开始敲击。人类非常善于发现有规律的声音,救援人员会开始朝着你的方向搜救。一旦你听到他们的声音,就可以大声呼救了。

Note: rubble (n.) 碎石;瓦砾

If a tornado looks like it's not moving, that means it's heading towards you.如果龙卷风看起来没有移动,那就意味着它正向你袭来。

[Photo/Boredpanda]

A lot of backpacks have a hidden built-in whistle. The actual clip on many modern day backpacks that are meant for hiking or camping have that built-in whistle.很多背包都带有一个隐藏的内置哨子。如今,不少远足或露营专用的双肩包的卡扣都有这种设计。

Photo by Daniel Jurin from Pexels

If you're ever at the beach and you see the water receding or far away from where it normally is, run. This normally means a tsunami is coming. And someone who paid attention in school in 2004 used this and saved their own life by getting out of there.如果你在海滩上看到海水逐渐后退或远离平常的位置,快跑!这通常意味着海啸即将来临。2004年,在学校认真听讲的人凭借这个知识点逃脱,挽救了自己的生命。

If you ever see square waves in the water, get out immediately. These waves have powerful currents under the water that can sweep you out and take you away.如果你在水中看到方波,立刻离开。这些波浪下隐藏着强大的水流,可以把你卷走。

If your car ever goes into water, open a window or door immediately. If you don't do this, the pressure differential is too great and it will keep everything shut and you have to wait until your car is completely filled with water in order to get out.如果你的车进水了,应该立即打开车窗或车门。如果不这样做,巨大的压差会将门窗都关死。到那时你只能等到车里完全充满了水才能逃出来。

If you're somewhere and you don't have the right size battery, you can use a smaller battery and put aluminum foil in that extra space and it will still work. The aluminum foil will transfer the electricity and get the job done.如果你在某个地方,没有合适尺寸的电池,可以使用更小号的电池,用铝箔填充空余的空间,这样也行得通。铝箔将传输电力并完成工作。

If someone falls in cold water and is close to hypothermia, don't put them next to a fire. They need to be warmed up slowly. Otherwise it could be potentially fatal and they could experience something called afterdrop. And this is due to the fact that your blood flow cannot adapt quick enough to that change from extreme cold to extreme hot.如果有人落入冷水中,接近失温,不要把他们安置在火旁边。需要慢慢让他们热起来。否则可能带来致命后果,使他们在复温时核心体温进一步下降。这是因为血液流动没那么快,能够让身体很快地适应从极冷到极热的变化。

Before natural disasters make sure to fill your tub up and your sink with water that is clean. According to the FDA, after major disasters, water's either cut off or heavily contaminated. So it's important to make sure you have enough supply of clean water.在自然灾害发生之前,一定要把你的浴缸和水槽装满干净的水。美国食品和药物管理局表示,在发生重大灾难后,水源要么被切断,要么被严重污染。所以确保你有充足的干净水很重要。

编辑:董静

来源:Boredpanda

来源:chinadaily.com.cn

.引用相关头文件

引入CSS:

<link href="Scripts/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" />

<link href="Scripts/ui.jqgrid.css" rel="stylesheet" type="text/css" />

引入JS:

<script src="Scripts/jquery-1.5.1.js" type="text/javascript"></script>

<script src="Scripts/jquery-ui.min.js" type="text/javascript"></script>

<script src="Scripts/grid.locale-en.js" type="text/javascript"></script>

<script src="Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>

因为jqGrid3.6及以后的版本集成了jQuery UI,所以,此处需要导入UI相关js和css。另外grid.locale-en.js这个语言文件必须在jquery.jqGrid.min.js之前加载,否则会出问题。

2.将jqgrid加入页面中

根据jqGrid的文档,要想生成一个jqGrid,最直接的方法就是:

$("#list").jqGrid(options);

其中list是页面上的一个table:<table id="list"></table>

下面是一个简单的例子:

<script type="text/javascript">

$(document).ready(function () {

jQuery("#list").jqGrid({

url: 'Handler.ashx',

datatype: "json",

mtype: 'GET',

colNames: ['SalesReasonID', 'Name', 'ReasonType', 'ModifiedDate'],

colModel: [

{ name: 'SalesReasonID', index: 'SalesReasonID', width: 40, align: "left", editable: true },

{ name: 'Name', index: 'Name', width: 100, align: "center" },

{ name: 'ReasonType', index: 'ReasonType', width: 100, align: "center" },

{ name: 'ModifiedDate', index: 'ModifiedDate', width: 150, align: "center", search: false }

],

rowList: [10, 20, 30],

sortname: 'SalesReasonID',

viewrecords: true,

sortorder: "desc",

jsonReader: {

root: "griddata",

total: "totalpages",

page: "currpage",

records: "totalrecords",

repeatitems: false

},

pager: jQuery('#pager'),

rowNum: 5,

altclass: 'altRowsColour',

//width: 'auto',

width: '500',

height: 'auto',

caption: "DemoGrid"

}).navGrid('#pager', { add: true, edit: true, del: true,search:false,refresh:false }); ;

})

二、 jqgrid的重要选项

具体的options参考,可以访问jqGrid文档关于option的章节(http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options)。其中有几个是比较常用的,重点介绍一下:

  • url :jqGrid控件通过这个参数得到需要显示的数据,具体的返回值可以使XML也可以是Json。
  • datatype :这个参数用于设定将要得到的数据类型。类型包括:json 、xml、xmlstring、local、javascript、function。
  • mtype : 定义使用哪种方法发起请求,GET或者POST。
  • height :Grid的高度,可以接受数字、%值、auto,默认值为150。
  • width :Grid的宽度,如果未设置,则宽度应为所有列宽的之和;如果设置了宽度,则每列的宽度将会根据shrinkToFit选项的设置,进行设置。
  • shrinkToFit :此选项用于根据width计算每列宽度的算法。默认值为true。如果shrinkToFit为true且设置了width值,则每列宽度会根据width成比例缩放;如果shrinkToFit为false且设置了width值,则每列的宽度不会成比例缩放,而是保持原有设置,而Grid将会有水平滚动条。
  • autowidth :默认值为false。如果设为true,则Grid的宽度会根据父容器的宽度自动重算。重算仅发生在Grid初始化的阶段;如果当父容器尺寸变化了,同时也需要变化Grid的尺寸的话,则需要在自己的代码中调用setGridWidth方法来完成。
  • pager :定义页码控制条Page Bar,在上面的例子中是用一个div(<div id=”pager”></div>)来放置的。
  • sortname :指定默认的排序列,可以是列名也可以是数字。此参数会在被传递到Server端。
  • viewrecords :设置是否在Pager Bar显示所有记录的总数。
  • caption :设置Grid表格的标题,如果未设置,则标题区域不显示。
  • rowNum :用于设置Grid中一次显示的行数,默认值为20。正是这个选项将参数rows(prmNames中设置的)通过url选项设置的链接传递到Server。注意如果Server返回的数据行数超过了rowNum的设定,则Grid也只显示rowNum设定的行数。
  • rowList :一个数组,用于设置Grid可以接受的rowNum值。例如[10,20,30]。
  • colNames :字符串数组,用于指定各列的题头文本,与列的顺序是对应的。
  • colModel :最重要的数组之一,用于设定各列的参数。(稍后详述)
  • prmNames :这是一个数组,用于设置jqGrid将要向Server传递的参数名称。(稍后详述)
  • jsonReader :这又是一个数组,用来设定如何解析从Server端发回来的json数据。(稍后详述)

2.1 prmNames选项

prmNames是jqGrid的一个重要选项,用于设置jqGrid将要向Server传递的参数名称。其默认值为:

prmNames : {

page:"page", // 表示请求页码的参数名称

rows:"rows", // 表示请求行数的参数名称

sort: "sidx", // 表示用于排序的列名的参数名称

order: "sord", // 表示采用的排序方式的参数名称

search:"_search", // 表示是否是搜索请求的参数名称

nd:"nd", // 表示已经发送请求的次数的参数名称

id:"id", // 表示当在编辑数据模块中发送数据时,使用的id的名称

oper:"oper", // operation参数名称

editoper:"edit", // 当在edit模式中提交数据时,操作的名称

addoper:"add", // 当在add模式中提交数据时,操作的名称

deloper:"del", // 当在delete模式中提交数据时,操作的名称

subgridid:"id", // 当点击以载入数据到子表时,传递的数据名称

npage: null,

totalrows:"totalrows" // 表示需从Server得到总共多少行数据的参数名称,参见jqGrid选项中的rowTotal

}

2.2 jsonReader选项

jsonReader是jqGrid的一个重要选项,用于设置如何解析从Server端发回来的json数据,如果Server返回的是xml数据,则对应的使用xmlReader来解析。jsonReader的默认值为:

jsonReader : {

root: "rows", // json中代表实际模型数据的入口

page: "page", // json中代表当前页码的数据

total: "total", // json中代表页码总数的数据

records: "records", // json中代表数据行总数的数据

repeatitems: true, // 如果设为false,则jqGrid在解析json时,会根据name来搜索对应的数据元素(即可以json中元素可以不按顺序);而所使用的name是来自于colModel中的name设定。

cell: "cell",

id: "id",

userdata: "userdata",

subgrid: {

root:"rows",

repeatitems: true,

cell:"cell"

}

}

假如有下面一个json字符串:

{"totalpages":"3","currpage":"1","totalrecords":"11","griddata":[{"SalesReasonID":"1","Name":"Price","ReasonType":"Other","ModifiedDate":"1998年6月1日"},{"SalesReasonID":"2","Name":"On Promotion","ReasonType":"Promotion","ModifiedDate":"1998年6月1日"},{"SalesReasonID":"3","Name":"Magazine Advertisement","ReasonType":"Marketing","ModifiedDate":"1998年6月1日"},{"SalesReasonID":"4","Name":"Television Advertisement","ReasonType":"Marketing","ModifiedDate":"1998年6月1日"},{"SalesReasonID":"5","Name":"Manufacturer","ReasonType":"Other","ModifiedDate":"1998年6月1日"}]}

其对应的jsonReader为:jsonReader: {

root: "griddata",

total: "totalpages",

page: "currpage",

records: "totalrecords",

repeatitems: false

}

注:cell、id在repeatitems为true时可以用到,即每一个记录是由一对id和cell组合而成,即可以适用另一种json结构。援引文档中的例子:

repeatitems为true时:

jQuery("#gridid").jqGrid({

...

jsonReader : {

root:"invdata",

page: "currpage",

total: "totalpages",

records: "totalrecords"

},

...

});

json结构为:

{

"totalpages": "xxx",

"currpage": "yyy",

"totalrecords": "zzz",

"invdata" : [

{"id" :"1", "cell" :["cell11", "cell12", "cell13"]}, // cell中不需要各列的name,只要值就OK了,但是需要保持对应

{"id" :"2", "cell" :["cell21", "cell22", "cell23"]},

...

]

}

repeatitems为false时:

jQuery("#gridid").jqGrid({

...

jsonReader : {

root:"invdata",

page: "currpage",

total: "totalpages",

records: "totalrecords",

repeatitems: false,

id: "0"

},

...

});

json结构为:

{

"totalpages" : "xxx",

"currpage" : "yyy",

"totalrecords" : "zzz",

"invdata" : [

{"invid" : "1","invdate":"cell11", "amount" :"cell12", "tax" :"cell13", "total" :"1234", "note" :"somenote"}, // 数据中需要各列的name,但是可以不按列的顺序

{"invid" : "2","invdate":"cell21", "amount" :"cell22", "tax" :"cell23", "total" :"2345", "note" :"some note"},

...

]

}

2.3 colModel的重要选项

colModel也有许多非常重要的选项,在使用搜索、排序等方面都会用到。这里先只说说最基本的。

  • name :为Grid中的每个列设置唯一的名称,这是一个必需选项,其中保留字包括subgrid、cb、rn。
  • index :设置排序时所使用的索引名称,这个index名称会作为sidx参数(prmNames中设置的)传递到Server。
  • label :当jqGrid的colNames选项数组为空时,为各列指定题头。如果colNames和此项都为空时,则name选项值会成为题头。
  • width :设置列的宽度,目前只能接受以px为单位的数值,默认为150。
  • sortable :设置该列是否可以排序,默认为true。
  • search :设置该列是否可以被列为搜索条件,默认为true。
  • resizable :设置列是否可以变更尺寸,默认为true。
  • hidden :设置此列初始化时是否为隐藏状态,默认为false。
  • formatter :预设类型或用来格式化该列的自定义函数名。常用预设格式有:integer、date、currency、number等(具体参见文档 )。

三、 注意事项

1. 动态改变Add Form或者Edit Form中的select的内容,如:改变下图中的Comparator下拉中的内容。

$("#list_d").navGrid('#pager_d',{add:true,edit:true,del:true,search:false,refresh:false},

{

checkOnSubmit:false, closeAfterEdit: true,recreateForm:true,

beforeInitData:function(formid){

initComparator();

},

beforeShowForm: function(formid){

$("#list_d").jqGrid('setColProp', 'Name', { editrules:{required:false},});

$('#tr_Name', formid).hide();

}

},//edit

{},//add

{}//del

beforeInitData, beforeShowForm在每次点击编辑的时候都会执行。initComparator的作用是通过ajax获取数据,然后利用$("#list_d").jqGrid('setColProp', 'Comparator', { editoptions: { value: valueString} });来设置Comparator下拉中的内容。其中valueString的格式如下’ equal to: equal to; not equal to: not equal to’。键值之间用冒号隔开,2项之间用分号隔开。注意:把recreateForm设为true,否则'setColProp'只在第一次调用时有效。

2. var rowNum=parseInt($(this).getGridParam("records"), 10); 得到数据条数。

3. jQuery("#list_d").clearGridData();清空数据。

4. jQuery("#list").getCell(ids,"Key");获取第ids行的key列。

5. $("#list").jqGrid('setSelection', "1");选中第一行。放在loadComplete:中在gird加载完成的时候自动选中第一行。loadComplete:function(data){$("#list").jqGrid('setSelection', "1");

}

6. 对于像1中的可编辑的字段,可以设定rule,参见http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules#editrules

7. 修改Option,以URL为例

jQuery("#list_d").jqGrid('setGridParam',{url:"xxx.aspx",page:1}).trigger('reloadGrid');