一個(gè)企業(yè)級(jí)的人 都置頂了 中國(guó)軟件網(wǎng)
中國(guó)軟件網(wǎng) 為你帶來(lái)最新鮮的行業(yè)干貨
編譯│周潤(rùn)智
谷歌的安卓版Chrome瀏覽器提供了一個(gè)值得贊美的瀏覽體驗(yàn),但是如果你知道如何解鎖這些更多的功能,Chrome會(huì)變得更加高效。
你的手機(jī)瀏覽器是你通向網(wǎng)站的途徑。在做重要的工作相關(guān)的研究時(shí),你會(huì)想要盡可能的高效率。下面的這四個(gè)設(shè)置都是關(guān)于如何提高你的工作效率的。
1.一個(gè)讓你的地址欄節(jié)省時(shí)間的小技巧
你大概已經(jīng)知道在安卓版Chrome瀏覽器中,你可以立即從地址欄中得到不管是問(wèn)題還是概念的答案。Chrome瀏覽器提供了另外一個(gè)有用的地址欄使用技巧。如果你像我一樣,這會(huì)是一個(gè)十分便捷的捷徑。每次你要從其他地方復(fù)制一個(gè)URL 到瀏覽器的時(shí)候,你必須要粘貼到你的瀏覽器中。如果你使用了這個(gè)便捷的功能,Chrome瀏覽器會(huì)自動(dòng)將剪貼板的任何地址呈現(xiàn)到你面前。
要使用這個(gè)功能,你首先需要使用Chrome的Beta測(cè)試版本。打開應(yīng)用,在地址欄中輸入"chrome://flags"。然后點(diǎn)擊在屏幕右上方的三點(diǎn)菜單按鈕,選擇"Find in page",在文本框內(nèi)輸入"clipboard"。之后,一個(gè)叫做"Omnibox clipboard URL suggestions."的頁(yè)面就會(huì)立即彈跳出來(lái)。在選項(xiàng)框中將”Default”改為”Enabled”。最后,瀏覽器會(huì)提示你重啟瀏覽器以啟動(dòng)應(yīng)用,設(shè)置就完成了。
2.使手機(jī)網(wǎng)頁(yè)更適合眼睛閱讀
在手機(jī)上閱讀通常不是一個(gè)令人愉快的體驗(yàn)。雜亂的頁(yè)面,不一致的字體等等都影響了我們的注意力。下一次遇到這樣雜亂的頁(yè)面,試試Chrome清掃頁(yè)面的隱形工具——閱讀模式。
這種模式清除了所有超鏈接元素,比如說(shuō)按鈕,鏈接甚至是廣告,并且將文章統(tǒng)一成了標(biāo)準(zhǔn)風(fēng)格的格式。
要激活這個(gè)選項(xiàng),先打開應(yīng)用,在地址欄中輸入"chrome://flags"。然后點(diǎn)擊在屏幕右上方的三點(diǎn)菜單按鈕,選擇"Find in page",在文本框內(nèi)輸入“reader”。你會(huì)看到一個(gè)“Reader Mode triggering”,點(diǎn)擊下面的選項(xiàng),選擇"With article structured markup." 就設(shè)定好了。
3 隨心所欲地放大縮小頁(yè)面
當(dāng)我在看一個(gè)手機(jī)版網(wǎng)頁(yè)的時(shí)候,禁止縮放這一點(diǎn)讓我很抓狂。幸運(yùn)的是,Chrome瀏覽器能夠讓你自由操控縮放。 打開瀏覽器的主設(shè)置,然后點(diǎn)擊"Accessibility" ,最后選擇"Force enable zoom."的選項(xiàng)就設(shè)置完成了。
4.將你的加載時(shí)間轉(zhuǎn)換到超速擋
每個(gè)人都希望網(wǎng)頁(yè)能夠更加快速地加載, Chorme瀏覽器有一個(gè)選項(xiàng)可以滿足人們的需求。
這個(gè)服務(wù)叫做Data Saver。它能在加載時(shí)輕微地壓縮和優(yōu)化內(nèi)容,這樣,網(wǎng)頁(yè)加載的速度就會(huì)加快,數(shù)據(jù)的使用也會(huì)降低。
要進(jìn)行這樣的設(shè)置,點(diǎn)擊Chrome的設(shè)置,找到"Data Saver"的選項(xiàng)。點(diǎn)擊它,然后窗口上方的按鈕開啟它。
你已經(jīng)解鎖了一些谷歌Chrome最有意思的隱藏設(shè)置,相信你的手機(jī)瀏覽體驗(yàn)會(huì)比以前更加的舒適完美。
▼
「原文連接」
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
們常說(shuō),“你永遠(yuǎn)不知道,明天和意外哪個(gè)先到來(lái)”。這個(gè)世界本就充滿危險(xiǎn),有的人前一刻還在河水中自在地游泳,下一刻可能就被一股暗流卷走。但這并不意味著我們要生活在擔(dān)驚受怕之中。相反,我們應(yīng)該注意學(xué)習(xí)安全知識(shí),做好防范,規(guī)避風(fēng)險(xiǎn)。
TikTok用戶Knowledgesaurus一直致力于安全知識(shí)科普,他制作了“可以救命的事實(shí)”系列視頻,其中提到了面對(duì)地震、海嘯、失溫等不同危險(xiǎn)情況的求生方法,視頻點(diǎn)擊量超過(guò)百萬(wàn)。一起來(lái)看看他的求生法則吧。
[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.如果你發(fā)現(xiàn)自己被埋在瓦礫中出不來(lái),不要大喊大叫。這樣最終只會(huì)讓你的精力耗盡,發(fā)不出聲來(lái)。你應(yīng)該做的是抓住某樣?xùn)|西,三次一間隔的開始敲擊。人類非常善于發(fā)現(xiàn)有規(guī)律的聲音,救援人員會(huì)開始朝著你的方向搜救。一旦你聽到他們的聲音,就可以大聲呼救了。
Note: rubble (n.) 碎石;瓦礫
If a tornado looks like it's not moving, that means it's heading towards you.如果龍卷風(fēng)看起來(lái)沒(méi)有移動(dòng),那就意味著它正向你襲來(lái)。
[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.很多背包都帶有一個(gè)隱藏的內(nèi)置哨子。如今,不少遠(yuǎn)足或露營(yíng)專用的雙肩包的卡扣都有這種設(shè)計(jì)。
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.如果你在海灘上看到海水逐漸后退或遠(yuǎn)離平常的位置,快跑!這通常意味著海嘯即將來(lái)臨。2004年,在學(xué)校認(rèn)真聽講的人憑借這個(gè)知識(shí)點(diǎn)逃脫,挽救了自己的生命。
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.如果你在水中看到方波,立刻離開。這些波浪下隱藏著強(qiáng)大的水流,可以把你卷走。
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.如果你的車進(jìn)水了,應(yīng)該立即打開車窗或車門。如果不這樣做,巨大的壓差會(huì)將門窗都關(guān)死。到那時(shí)你只能等到車?yán)锿耆錆M了水才能逃出來(lái)。
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.如果你在某個(gè)地方,沒(méi)有合適尺寸的電池,可以使用更小號(hào)的電池,用鋁箔填充空余的空間,這樣也行得通。鋁箔將傳輸電力并完成工作。
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.如果有人落入冷水中,接近失溫,不要把他們安置在火旁邊。需要慢慢讓他們熱起來(lái)。否則可能帶來(lái)致命后果,使他們?cè)趶?fù)溫時(shí)核心體溫進(jìn)一步下降。這是因?yàn)檠毫鲃?dòng)沒(méi)那么快,能夠讓身體很快地適應(yīng)從極冷到極熱的變化。
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.在自然災(zāi)害發(fā)生之前,一定要把你的浴缸和水槽裝滿干凈的水。美國(guó)食品和藥物管理局表示,在發(fā)生重大災(zāi)難后,水源要么被切斷,要么被嚴(yán)重污染。所以確保你有充足的干凈水很重要。
編輯:董靜
來(lái)源:Boredpanda
來(lái)源:chinadaily.com.cn
.引用相關(guān)頭文件
引入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>
因?yàn)閖qGrid3.6及以后的版本集成了jQuery UI,所以,此處需要導(dǎo)入U(xiǎn)I相關(guān)js和css。另外grid.locale-en.js這個(gè)語(yǔ)言文件必須在jquery.jqGrid.min.js之前加載,否則會(huì)出問(wèn)題。
2.將jqgrid加入頁(yè)面中
根據(jù)jqGrid的文檔,要想生成一個(gè)jqGrid,最直接的方法就是:
$("#list").jqGrid(options);
其中l(wèi)ist是頁(yè)面上的一個(gè)table:<table id="list"></table>
下面是一個(gè)簡(jiǎn)單的例子:
<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的重要選項(xiàng)
具體的options參考,可以訪問(wèn)jqGrid文檔關(guān)于option的章節(jié)(http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options)。其中有幾個(gè)是比較常用的,重點(diǎn)介紹一下:
2.1 prmNames選項(xiàng)
prmNames是jqGrid的一個(gè)重要選項(xiàng),用于設(shè)置jqGrid將要向Server傳遞的參數(shù)名稱。其默認(rèn)值為:
prmNames : {
page:"page", // 表示請(qǐng)求頁(yè)碼的參數(shù)名稱
rows:"rows", // 表示請(qǐng)求行數(shù)的參數(shù)名稱
sort: "sidx", // 表示用于排序的列名的參數(shù)名稱
order: "sord", // 表示采用的排序方式的參數(shù)名稱
search:"_search", // 表示是否是搜索請(qǐng)求的參數(shù)名稱
nd:"nd", // 表示已經(jīng)發(fā)送請(qǐng)求的次數(shù)的參數(shù)名稱
id:"id", // 表示當(dāng)在編輯數(shù)據(jù)模塊中發(fā)送數(shù)據(jù)時(shí),使用的id的名稱
oper:"oper", // operation參數(shù)名稱
editoper:"edit", // 當(dāng)在edit模式中提交數(shù)據(jù)時(shí),操作的名稱
addoper:"add", // 當(dāng)在add模式中提交數(shù)據(jù)時(shí),操作的名稱
deloper:"del", // 當(dāng)在delete模式中提交數(shù)據(jù)時(shí),操作的名稱
subgridid:"id", // 當(dāng)點(diǎn)擊以載入數(shù)據(jù)到子表時(shí),傳遞的數(shù)據(jù)名稱
npage: null,
totalrows:"totalrows" // 表示需從Server得到總共多少行數(shù)據(jù)的參數(shù)名稱,參見(jiàn)jqGrid選項(xiàng)中的rowTotal
}
2.2 jsonReader選項(xiàng)
jsonReader是jqGrid的一個(gè)重要選項(xiàng),用于設(shè)置如何解析從Server端發(fā)回來(lái)的json數(shù)據(jù),如果Server返回的是xml數(shù)據(jù),則對(duì)應(yīng)的使用xmlReader來(lái)解析。jsonReader的默認(rèn)值為:
jsonReader : {
root: "rows", // json中代表實(shí)際模型數(shù)據(jù)的入口
page: "page", // json中代表當(dāng)前頁(yè)碼的數(shù)據(jù)
total: "total", // json中代表頁(yè)碼總數(shù)的數(shù)據(jù)
records: "records", // json中代表數(shù)據(jù)行總數(shù)的數(shù)據(jù)
repeatitems: true, // 如果設(shè)為false,則jqGrid在解析json時(shí),會(huì)根據(jù)name來(lái)搜索對(duì)應(yīng)的數(shù)據(jù)元素(即可以json中元素可以不按順序);而所使用的name是來(lái)自于colModel中的name設(shè)定。
cell: "cell",
id: "id",
userdata: "userdata",
subgrid: {
root:"rows",
repeatitems: true,
cell:"cell"
}
}
假如有下面一個(gè)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日"}]}
其對(duì)應(yīng)的jsonReader為:jsonReader: {
root: "griddata",
total: "totalpages",
page: "currpage",
records: "totalrecords",
repeatitems: false
}
注:cell、id在repeatitems為true時(shí)可以用到,即每一個(gè)記錄是由一對(duì)id和cell組合而成,即可以適用另一種json結(jié)構(gòu)。援引文檔中的例子:
repeatitems為true時(shí):
jQuery("#gridid").jqGrid({
...
jsonReader : {
root:"invdata",
page: "currpage",
total: "totalpages",
records: "totalrecords"
},
...
});
json結(jié)構(gòu)為:
{
"totalpages": "xxx",
"currpage": "yyy",
"totalrecords": "zzz",
"invdata" : [
{"id" :"1", "cell" :["cell11", "cell12", "cell13"]}, // cell中不需要各列的name,只要值就OK了,但是需要保持對(duì)應(yīng)
{"id" :"2", "cell" :["cell21", "cell22", "cell23"]},
...
]
}
repeatitems為false時(shí):
jQuery("#gridid").jqGrid({
...
jsonReader : {
root:"invdata",
page: "currpage",
total: "totalpages",
records: "totalrecords",
repeatitems: false,
id: "0"
},
...
});
json結(jié)構(gòu)為:
{
"totalpages" : "xxx",
"currpage" : "yyy",
"totalrecords" : "zzz",
"invdata" : [
{"invid" : "1","invdate":"cell11", "amount" :"cell12", "tax" :"cell13", "total" :"1234", "note" :"somenote"}, // 數(shù)據(jù)中需要各列的name,但是可以不按列的順序
{"invid" : "2","invdate":"cell21", "amount" :"cell22", "tax" :"cell23", "total" :"2345", "note" :"some note"},
...
]
}
2.3 colModel的重要選項(xiàng)
colModel也有許多非常重要的選項(xiàng),在使用搜索、排序等方面都會(huì)用到。這里先只說(shuō)說(shuō)最基本的。
三、 注意事項(xiàng)
1. 動(dòng)態(tài)改變Add Form或者Edit Form中的select的內(nèi)容,如:改變下圖中的Comparator下拉中的內(nèi)容。
$("#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在每次點(diǎn)擊編輯的時(shí)候都會(huì)執(zhí)行。initComparator的作用是通過(guò)ajax獲取數(shù)據(jù),然后利用$("#list_d").jqGrid('setColProp', 'Comparator', { editoptions: { value: valueString} });來(lái)設(shè)置Comparator下拉中的內(nèi)容。其中valueString的格式如下’ equal to: equal to; not equal to: not equal to’。鍵值之間用冒號(hào)隔開,2項(xiàng)之間用分號(hào)隔開。注意:把recreateForm設(shè)為true,否則'setColProp'只在第一次調(diào)用時(shí)有效。
2. var rowNum=parseInt($(this).getGridParam("records"), 10); 得到數(shù)據(jù)條數(shù)。
3. jQuery("#list_d").clearGridData();清空數(shù)據(jù)。
4. jQuery("#list").getCell(ids,"Key");獲取第ids行的key列。
5. $("#list").jqGrid('setSelection', "1");選中第一行。放在loadComplete:中在gird加載完成的時(shí)候自動(dòng)選中第一行。loadComplete:function(data){$("#list").jqGrid('setSelection', "1");
}
6. 對(duì)于像1中的可編輯的字段,可以設(shè)定rule,參見(jiàn)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');
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。