info.magnolia.templating.editor.client.jsni
Class JavascriptUtils

java.lang.Object
  extended by info.magnolia.templating.editor.client.jsni.JavascriptUtils

public final class JavascriptUtils
extends Object

A JSNI wrapper around native javascript functions found in general.js, inline.js and others plus some utilities.

Version:
$Id$

Method Summary
static String detectCurrentLocale()
          A String representing the value for the GWT meta property whose content is locale.
static void exposeMgnlMessagesToGwtDictionary(String basename)
          Exposes the messages object corresponding to the passed in basename as a global (thus accessible by GWT Dictionary) variable named mgnlGwtMessages.
static String getContextPath()
           
static void getCookieContentId()
           
static void getCookiePosition()
           
static String getI18nMessage(String key)
          This method will look for the specified key inside a GWT Dictionary named mgnlGwtMessages.
static String getWindowLocation()
           
static boolean isEmpty(String string)
           
static boolean isNotEmpty(String string)
           
static void mgnlDeleteNode(String path)
           
static void mgnlMoveNodeEnd(Object source, String path)
           
static void mgnlMoveNodeHigh(Object source)
           
static void mgnlMoveNodeReset(Object source)
           
static void mgnlMoveNodeStart(String id)
           
static void mgnlOpenDialog(String path, String collectionName, String nodeName, String paragraph, String workspace, String dialogPage, String width, String height, String locale)
           
static void moveComponent(String idTarget, String idSource, String path, String order)
           
static void removeEditorContentIdCookie()
           
static void removeEditorPositionCookie()
           
static void resetEditorCookies()
          Removes all editor cookies not belonging to this page/module.
static void setEditorContentIdCookie(String value)
           
static void setEditorPositionCookie(String value)
           
static void setWindowLocation(String windowLocation)
           
static void showTree(String workspace, String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWindowLocation

public static String getWindowLocation()

setWindowLocation

public static void setWindowLocation(String windowLocation)

mgnlOpenDialog

public static void mgnlOpenDialog(String path,
                                  String collectionName,
                                  String nodeName,
                                  String paragraph,
                                  String workspace,
                                  String dialogPage,
                                  String width,
                                  String height,
                                  String locale)

mgnlMoveNodeStart

public static void mgnlMoveNodeStart(String id)

mgnlMoveNodeHigh

public static void mgnlMoveNodeHigh(Object source)

mgnlMoveNodeEnd

public static void mgnlMoveNodeEnd(Object source,
                                   String path)

mgnlMoveNodeReset

public static void mgnlMoveNodeReset(Object source)

mgnlDeleteNode

public static void mgnlDeleteNode(String path)

exposeMgnlMessagesToGwtDictionary

public static void exposeMgnlMessagesToGwtDictionary(String basename)
Exposes the messages object corresponding to the passed in basename as a global (thus accessible by GWT Dictionary) variable named mgnlGwtMessages.


showTree

public static void showTree(String workspace,
                            String path)

getContextPath

public static String getContextPath()

isNotEmpty

public static boolean isNotEmpty(String string)

isEmpty

public static boolean isEmpty(String string)

getI18nMessage

public static String getI18nMessage(String key)
This method will look for the specified key inside a GWT Dictionary named mgnlGwtMessages. If the key does not exist it will return a string in the form ???missing.key???. The keys looked for must reside in info.magnolia.module.admininterface.messages and MUST end with the special suffix .js (i.e. my.cool.i18nkey.js).

WARNING: this way of exposing i18n messages to GWT is very likely to change in 5.0


detectCurrentLocale

public static String detectCurrentLocale()
A String representing the value for the GWT meta property whose content is locale. See also GWT Dev Guide to i18n


moveComponent

public static void moveComponent(String idTarget,
                                 String idSource,
                                 String path,
                                 String order)

resetEditorCookies

public static void resetEditorCookies()
Removes all editor cookies not belonging to this page/module. Each time we navigate to a different link within the webapp the GWT module is unloaded and then reloaded, we need a clean slate when accessing cookies on a given page to avoid weird behaviour, i.e. page scrolling to last saved position when you come back to it after having been on a different page.


setEditorPositionCookie

public static void setEditorPositionCookie(String value)

setEditorContentIdCookie

public static void setEditorContentIdCookie(String value)

getCookiePosition

public static void getCookiePosition()

getCookieContentId

public static void getCookieContentId()

removeEditorContentIdCookie

public static void removeEditorContentIdCookie()

removeEditorPositionCookie

public static void removeEditorPositionCookie()


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.