This project is read-only.

This repository has moved to GitHub. Please visit the new repository at https://github.com/Lombiq/Orchard-Scripting-Extensions-JavaScript.

The CodePlex page is not maintained anymore, but still here for historical reference.

Documentation

This module depends on JavaScript.Net Orchard and Orchard Scripting Extensions. It uses many of the latter's features. Please install it first! (And also read that module's docs to see what you can do with it - and through it, with JavaScript).
JavaScript execution goes through the excellent Javascript .NET library.

Samples

var hello = "Hello JavaScript!"; 
hello; // The last statement will be the output of the script

// You can instantiate types that were loaded to the script context through the Factory object
var obj = Factory.Create("System.Object", null);
obj.ToString(); // Outputs "System.Object"

// There is an Orchard global variable that you can add fields to. By default it contains a WorkContext field with the Orchard WorkContext and an OrchardServices field with an IOrchardServices instance
Orchard.WorkContext.CurrentSite.SiteName;

// This adds the string "Hello!' to the markup of the layout's Body zone (this will just show up in the html source!).
Orchard.Layout.Get("Body").Add("Hello!"); 

Version history

  • v1.0 (17.12.2012):

Last edited Nov 27, 2015 at 6:02 PM by MilanKeszthelyi, version 8

Comments

No comments yet.