Skip to content

Commit a08e630

Browse files
committed
Add instructions and purpose to README
1 parent dafc51d commit a08e630

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed
6.66 KB
Binary file not shown.

README.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
11
DNN JavaScript Libraries
22
===============
33

4-
This repository contains DNN JavaScript Library extensions, wrapping some common
5-
JavaScript libraries for use in DNN.
4+
Version 7.2 of the [DNN Platform](http://www.dnnsoftware.com) introduced the
5+
JavaScript Library extension type. This allows common JavaScript libraries to
6+
exist in a single place within a DNN site, instead of every module, skin, and
7+
piece of content that wants to include them using their own. DNN presently
8+
comes with libraries for jQuery, jQuery UI, jQuery Migrate, Knockout, and
9+
Knockout Mapping.
10+
In addition to these built-in libraries, new libraries can be installed into
11+
DNN, and used by various components. DNN allows multiple versions of a
12+
JavaScript library to be used, so one module can request a particular version
13+
of a script, while another requests another. So long as they aren't on the same
14+
page, they will get what they requested; otherwise, DNN will use the higher
15+
version.
16+
17+
Goal
18+
===============
19+
20+
The main benefits in using JavaScript Libraries are realized when they are used
21+
by many separate components within a DNN site (i.e. when there is one common
22+
set of libraries and separate, unrelated DNN skins and modules use those
23+
libraries instead of packaging scripts directly into the extension). In order
24+
to aid in that goal, we are attempting to create a central repository
25+
of common JavaScript Libraries that can be used by many different DNN extension
26+
developers.
27+
28+
Usage
29+
===============
30+
31+
Skins
32+
---------------
33+
Starting in DNN 7.3, there is a skin object called `JavaScriptLibraryInclude`
34+
which can be used to request a JavaScript library (including jQuery, but also
35+
any 3rd party library) from a skin. To do that, you need to register the skin
36+
object at the top of your skin:
37+
38+
<%@ Register TagPrefix="dnn" TagName="JavaScriptLibraryInclude" Src="~/admin/Skins/JavaScriptLibraryInclude.ascx" %>
39+
40+
Then, in the body of the skin, use the skin object to request the library:
41+
42+
<dnn:JavaScriptLibraryInclude runat="server" Name="jQuery" />
43+
<dnn:JavaScriptLibraryInclude runat="server" Name="jQuery-UI" Version="1.10.3" />
44+
<dnn:JavaScriptLibraryInclude runat="server" Name="jQuery-Migrate" Version="1.2.1" SpecificVersion="LatestMajor" />
45+
46+
HTML Skins
47+
---------------
48+
The skin object mentioned above can also be used from HTML skins. It would look something like this:
49+
50+
<object codetype="dotnetnuke/server" codebase="JavaScriptLibraryInclude">
51+
<param name="Name" value="jQuery" />
52+
<param name="Version" value="1.9.1" />
53+
</object>
654

755
License
8-
-------
56+
---------------
957

1058
This code is released under the [MIT license](LICENSE.md).
11-
However, the individual libraries are licensed by their respective owners.
59+
However, the individual libraries are licensed by their respective owners.

0 commit comments

Comments
 (0)