* mediaResource.getById(1234)
* .then(function(media) {
- * var myMedia = media;
+ * var myMedia = media;
* alert('its here!');
* });
- *
- *
- * @param {Int} id id of media item to return
+ *
+ *
+ * @param {Int} id id of media item to return
* @returns {Promise} resourcePromise object containing the media item.
*
*/
@@ -163,9 +163,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert('its gone!');
* });
- *
- *
- * @param {Int} id id of media item to delete
+ *
+ *
+ * @param {Int} id id of media item to delete
* @returns {Promise} resourcePromise object.
*
*/
@@ -191,12 +191,12 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* mediaResource.getByIds( [1234,2526,28262])
* .then(function(mediaArray) {
- * var myDoc = contentArray;
+ * var myDoc = contentArray;
* alert('they are here!');
* });
- *
- *
- * @param {Array} ids ids of media items to return as an array
+ *
+ *
+ * @param {Array} ids ids of media items to return as an array
* @returns {Promise} resourcePromise object containing the media items array.
*
*/
@@ -223,28 +223,28 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* @description
* Returns a scaffold of an empty media item, given the id of the media item to place it underneath and the media type alias.
- *
+ *
* - Parent Id must be provided so umbraco knows where to store the media
- * - Media Type alias must be provided so umbraco knows which properties to put on the media scaffold
- *
+ * - Media Type alias must be provided so umbraco knows which properties to put on the media scaffold
+ *
* The scaffold is used to build editors for media that has not yet been populated with data.
- *
+ *
* ##usage
*
* mediaResource.getScaffold(1234, 'folder')
* .then(function(scaffold) {
* var myDoc = scaffold;
- * myDoc.name = "My new media item";
+ * myDoc.name = "My new media item";
*
* mediaResource.save(myDoc, true)
* .then(function(media){
* alert("Retrieved, updated and saved again");
* });
* });
- *
- *
+ *
+ *
* @param {Int} parentId id of media item to return
- * @param {String} alias mediatype alias to base the scaffold on
+ * @param {String} alias mediatype alias to base the scaffold on
* @returns {Promise} resourcePromise object containing the media scaffold.
*
*/
@@ -283,11 +283,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* mediaResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
* .then(function(contentArray) {
- * var children = contentArray;
+ * var children = contentArray;
* alert('they are here!');
* });
- *
- *
+ *
+ *
* @param {Int} parentid id of content item to return children of
* @param {Object} options optional options object
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 0
@@ -361,9 +361,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* @description
* Saves changes made to a media item, if the media item is new, the isNew paramater must be passed to force creation
- * if the media item needs to have files attached, they must be provided as the files param and passed separately
- *
- *
+ * if the media item needs to have files attached, they must be provided as the files param and passed separately
+ *
+ *
* ##usage
*
* mediaResource.getById(1234)
@@ -374,11 +374,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* alert("Retrieved, updated and saved again");
* });
* });
- *
- *
+ *
+ *
* @param {Object} media The media item object with changes applied
- * @param {Bool} isNew set to true to create a new item or to update an existing
- * @param {Array} files collection of files for the media item
+ * @param {Bool} isNew set to true to create a new item or to update an existing
+ * @param {Array} files collection of files for the media item
* @returns {Promise} resourcePromise object containing the saved media item.
*
*/
@@ -400,10 +400,10 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function(folder) {
* alert('New folder');
* });
- *
+ *
*
* @param {string} name Name of the folder to create
- * @param {int} parentId Id of the media item to create the folder underneath
+ * @param {int} parentId Id of the media item to create the folder underneath
* @returns {Promise} resourcePromise object.
*
*/
@@ -427,18 +427,19 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* Retrieves all media children with types used as folders.
* Uses the convention of looking for media items with mediaTypes ending in
* *Folder so will match "Folder", "bannerFolder", "secureFolder" etc,
- *
- * NOTE: This will return a max of 500 folders, if more is required it needs to be paged
- *
+ *
+ * NOTE: This will return a page of max 500 folders, if more is required it needs to be paged
+ * and then folders are in the .items property of the returned promise data
+ *
* ##usage
*
* mediaResource.getChildFolders(1234)
- * .then(function(data) {
+ * .then(function(page) {
* alert('folders');
* });
- *
+ *
*
- * @param {int} parentId Id of the media item to query for child folders
+ * @param {int} parentId Id of the media item to query for child folders
* @returns {Promise} resourcePromise object.
*
*/
@@ -454,9 +455,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
"mediaApiBaseUrl",
"GetChildFolders",
{
- id: parentId
+ id: parentId,
+ pageNumber: 1,
+ pageSize: 500
})),
- 'Failed to retrieve child folders for media item ' + parentId);
+ 'Failed to retrieve child folders for media item ' + parentId);
},
/**
@@ -473,8 +476,8 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert('its empty!');
* });
- *
- *
+ *
+ *
* @returns {Promise} resourcePromise object.
*
*/
@@ -501,8 +504,8 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function(searchResult) {
* alert('it's here!');
* });
- *
- *
+ *
+ *
* @param {string} query The search query
* @param {int} pageNumber The page number
* @param {int} pageSize The number of media items on a page
@@ -513,7 +516,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
search: function (query, pageNumber, pageSize, searchFrom) {
var args = [
- { "query": query },
+ { "query": query },
{ "pageNumber": pageNumber },
{ "pageSize": pageSize },
{ "searchFrom": searchFrom }
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js
index 6fc20524e9..2e71ef0bf5 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/templatehelper.service.js
@@ -22,7 +22,8 @@
function getQuerySnippet(queryExpression) {
var code = "\n@{\n" + "\tvar selection = " + queryExpression + ";\n}\n";
code += "
- ]]>
-
-
- ]]>
-
-
- ]]>
-
-
- ]]>
-
-
- ]]>
-
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
-
-
-
- ]]>
-
- ]]>
-
-
- ]]>
-
-
- ]]>
-
- ]]>
-
- ]]>
-
- Upload all the files in an ItemGroup:
- '%(RecursiveDir)%(Filename)%(Extension)')" />
- ]]>
-
- ]]>
-
-
-
-
-
- ]]>
- If the directory exists on the server you should see the following output in the console:
-
-
- ]]>
- To go a little step further. If the local directory looked like this:
-
- [mywebsite]
- [images]
- 1.gif
- 2.gif
- 3.gif
- [js]
- clientscript.js
- nofocus.js
- [css]
- print.css
- main.css
- index.htm
- contact.htm
- downloads.htm
-
- All directories and there content will be uploaded and a excact copy of the content of
- ]]>
-
- ]]>
-
- ]]>
-
-
-
- \G[^<]+
- RegexOptions.Singleline | RegexOptions.Multiline
-
-
- \G<%--(([^-]*)-)*?-%>
- RegexOptions.Singleline | RegexOptions.Multiline
-
-
- \G<%(?![@%])(?<code>.*?)%>
- RegexOptions.Singleline | RegexOptions.Multiline
- MSBuild.Community.RegularExpressions
-
-
-
-
-
-
-]]>
-
-
- ]]>
-
- ]]>
-
- ]]>
- ]]>
-
- ]]>
-
-
- ]]>
-
- ]]>
-
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
- ]]>
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
-
- ]]>
-
- The
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
- ]]>
-
-
- ]]>
-
- Using a changes.xml file with the following contents:
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
- You could use the following task definition, which relies on a property "TargetEnvironment" to determine which set of changes to apply:
-
- ]]>
-
- You will need to provide a value of "test" or "prod" to the TargetEnvironment property. The property can be defined in a PropertyGroup section of the MSBuild file, or passed as a command-line parameter.
-
-
-
-
-
-
-/>]]>
-
-
- ]]>
-
- ]]>
-
-
-
-
- ]]>
-
-
- ]]>
-
- $(testDir)\ilmergetest.dll
- $(testDir)\keypair.snk
- $(testDir)\ExcludeTypes.txt
- $(testDir)\ilmergetest.log
-
-
-
-
-
-
-
-
- ]]>
-
-
-]]>
-
-
-
-]]>
-
-
-
-
-
-
-]]>
-
-
- ]]>
-
- ]]>
-
-
-
-
-
-]]>
-
- Above example will display:
- 12 modulo 4 = 0
-
-
-
-
-
-]]>
-
- Above example will display:
- 14 modulo 4 = 2
-
-
-
-
-
-]]>
-
- Above example will display:
- 12 modulo 3.5 = 1.5
-
-
-
- ]]>
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
- Server=localhost;Integrated Security=True
-
-
-
-
-
- ]]>
-
-
-
-
-
-
- ]]>
-
-
- MSBuild Community Tasks
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
- ]]>
- Set property "BuildDate" to the current date and time:
-
-
- ]]>
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-/>]]>
-
- ]]>
- the
- The xml files of parameter
- If only one input file is provided,
- merging and wrapping can be omitted
- by setting
- The root tag can be given any number of attributes
- by providing a list of semicolon-delimited name/value pairs
- to parameter RootAttributes="foo=bar;date=$(buildDate)"
-
- Parameter RootAttributes=""
- must be specified explicitely.
-
- The xsl transformation file
- specified by parameter
- The
- If only one input file is given with
- The output is written to the file
- specified by parameter
-
-
- $(project)
- $(configuration)
- $(MSBuildProjectFullPath)
- $(MSBuildBinPath)
- $(MSBuildCommunityTasksPath)\$(nunitReportXsl)
-
-
-
-
-
- ]]>
-
-
- This examples shows all available task attributes:
-
-
-
-
-
- ]]>
-
- RootAttributes="foo=bar;date=$(buildDate)"
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
- ]]>
-
-
-
-
- ]]>
-
-
-
-
-
-]]>
-
- Above example will display:
- Divide 1/2= 0.5
-
-
-
-
-
-]]>
-
- Above example will display:
- Divide 7/3= 2
-
-
-
-
- ]]>
-
-
-
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
-
-
-
- ]]>
-
-
-
-
- ]]>
-
- ]]>
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
- ]]>
-
- ]]>
-
- Example of returning the items of a table in an xml format.
-
- ]]>
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
- ]]>
-
- ]]>
-
-
-
-
-
-
-
- ]]>
-
-
-
-
-
-
-
- ]]>
-
- ]]>
-
- ]]>
-
- ]]>
-
-
-
-
- ]]>
-
- ]]>
-
-
-
-
-
-
- ]]>
- Create a zip file using a working directory.
-
-
-
-
-
-
- ]]>
-
- list = new List();
- list.Add("Happy");
- list.Add("New");
- list.Add("Year");
- Console.WriteLine("Hello MSBuild Community Scripting World.");
- foreach(string s in list)
- {
- Console.WriteLine(s);
- }
- }
- ]]>
-
-