Subtitles section Play video
(logo chimes)
(標誌鐘聲)
- [Phil] Let's start looking at
- [菲爾]讓我們開始看一下
some of the things that JavaScript
腳本中的一些內容
is used for in SharePoint.
是在SharePoint中使用的。
Now, before we begin,
現在,在我們開始之前。
I have another disclaimer for you.
我還有一個免責聲明給你。
You cannot embed JavaScript on SharePoint
您不能在SharePoint上嵌入JavaScript
modern experience pages,
現代體驗頁面。
at least not at this time.
至少在這個時候沒有。
Microsoft has realized that a lot
微軟已經意識到,很多
of the service issues they need to solve
他們需要解決的服務問題的
for people are the result of them modifying CSS,
對於人們來說,是他們修改CSS的結果。
changing master pages,
改變主頁面。
creating custom themes, et cetera.
創建自定義主題,等等。
Their response has been to increasingly
他們的反應是,越來越多地
lock down what people can do in SharePoint,
鎖定人們可以在SharePoint中做什麼。
basically removing the problematic features.
基本上刪除了有問題的特徵。
Unfortunately, these are pretty valuable things.
不幸的是,這些都是相當有價值的東西。
So you can imagine the squawking.
是以,你可以想象一下,他們的叫聲。
I personally think that at some point,
我個人認為,在某些時候。
they'll be forced to restore features,
他們會被迫恢復功能。
but for now,
但就目前而言。
if you want finer control of your sites,
如果你想對你的網站進行更精細的控制。
you'll want to stick to the classic experience
你會想堅持經典的經驗
wherever possible.
在可能的情況下。
That's sad, but it's the way it is.
這很可悲,但這就是事實。
Anyways.
不管怎麼說。
Thing number one you can do with JavaScript.
第一件事,你可以用JavaScript做。
It lets you add or modify UI elements
它可以讓你添加或修改UI元素
on the screen.
在螢幕上。
I can actually give you a great example
實際上我可以給你一個很好的例子
of where SharePoint is already using JavaScript.
的地方,SharePoint已經在使用JavaScript。
This is stuff that's happening behind the scenes
這是在幕後發生的事情
when you change views for libraries
當你改變圖書館的視圖時
or lists.
或名單。
Let's take this library as an example.
讓我們以這個庫為例。
Here's the normal view.
這裡是正常的視圖。
Now what happens if I go in,
現在,如果我進去了會怎麼樣。
and modify the view.
並修改該視圖。
More specifically, what happens
更具體地說,會發生什麼
if I change the view style.
如果我改變視圖樣式。
I'm always surprised at how few people
我總是驚訝於很少有人
seem to know about view styles.
似乎對視圖樣式有所瞭解。
This is a fairly useful little tool
這是一個相當有用的小工具
that changes the way view information
改變查看資訊的方式
is displayed above and beyond specifying,
顯示的是高於和超過指定的。
which fields are shown filtering and the like.
哪些字段顯示為過濾等等。
I'm going to pick this newsletter
我將選擇這份通訊
no lines style,
沒有線條的風格。
and will apply that.
並將應用於此。
So the look of the list has changed noticeably.
是以,名單的外觀有了明顯的變化。
We have alternating lines,
我們有交替的線路。
the lines themselves are spaced out differently.
線條本身的間距也不同。
What happened?
發生了什麼事?
Let's take a quick look
讓我們快速瀏覽一下
at the page source in developer mode.
在開發者模式下,在頁面源頭。
Check out this script down here.
請看下面這個腳本。
This section is looking for what form
本節尋找的是什麼形式
we are using for our data display,
我們正在使用的數據顯示。
and just a little further along,
而只是再往前走一點。
there's basically all the changes described,
基本上有所述的所有變化。
and put into play.
並投入使用。
Other ways you could use JavaScript for UI.
你可以用JavaScript來做用戶界面的其他方式。
Let's say you wanted to change
比方說,你想改變
the actual input form.
實際的輸入表格。
By redefining the form,
通過重新定義的形式。
and form displays with JavaScript,
和表單顯示的JavaScript。
you can make one column into two
你可以把一列變成兩列
or change font colors.
或改變字體顏色。
Yes.
是的。
There are other tools you can use to do this,
還有其他工具可以用來做這件事。
but this is definitely a way to coax
但這絕對是一種哄騙的方式
a little bit more out of your sites
從你的網站上獲得更多的資訊
with JavaScript.
用JavaScript。
(upbeat instrumental music)
(歡快的器樂)