TextSide Site Class


TextSide provides a built in static Javascript class called Site. This static class provides contains information about the current page that the user is viewing as well as some static methods for showing some status indicators, such as the global 'loading' box in the upper right hand corner. The Site class can be found in site\webroot\js\core.js.

Member Variables


SiteRoot
The root path of your website. For example http://www.yoursite.com/. Combine with Url to determine the Url to your current page.

Url
The Url of the current page being used, relative to the SiteRoot. For example: pages/mypage. Combine with SiteRoot to obtain the full Url: Site.SiteRoot + Site.Url.

PageId
An int, this is the ID of the current page being viewed as it is stored in the database.

Member Methods


ShowLoading()
Shows a Loading indicator in the upper right hand corner of the page. This can be used when you are using AJAX class and you wish to notify the user that you are current processing something.

HideLoading()
Hides the Loading indicator that was showing using ShowLoading()

ShowMessage(message)
Shows the given message in an indicator in the upper right hand corner of the screen. This message will remain visible until HideMessage is called.
message - The Message to show

HideMessage
Hides any message show using ShowMessage()

FlashMessage(message, milliseconds)
Shows a message (the same as ShowMessage()) to the user in the upper right hand corner of the page for the specified time.
message - A message to show
millsieconds - How long to show the message for, measured in milliseconds. Example: 1000 = 1 second

Debug.Out(message)
Allows you to output a Debug message in your Javascript code. If the Debug Part has been placed on the same page - all Debug Out messages will be placed there.