Index: xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/xwiki.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/xwiki.js (revision f926854c3a1a78a8f5c47e7b5e72748d07cdcc8e) +++ xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/xwiki.js (revision ) @@ -1279,6 +1279,12 @@ /* Initialize the document URL factory, and create XWiki.currentDocument. TODO: use the new API to get the document meta data (see: http://jira.xwiki.org/browse/XWIKI-11225) */ var htmlElement = $(document.documentElement); +if (htmlElement.readAttribute('data-xwiki-reference')) { + // HTML 5 attribute + XWiki.Document.currentReference = XWiki.Model.resolve(htmlElement.readAttribute('data-xwiki-reference')); +} else { + XWiki.Document.currentReference = XWiki.Model.resolve("xwiki:Main.WebHome"); +} XWiki.Document.currentWiki = XWiki.currentWiki || "xwiki"; if (htmlElement.readAttribute('data-xwiki-wiki')) { // HTML 5 attribute @@ -1286,7 +1292,9 @@ } else if ($$("meta[name=wiki]").length > 0) { // Old meta tag XWiki.Document.currentWiki = $$("meta[name=wiki]")[0].content -} +} +// Starting with XWiki 7.2M1, the currentSpace variable holds a space reference (i.e. one or several spaces separated +// by dots, e.g. "space1.space2"). XWiki.Document.currentSpace = XWiki.currentSpace || "Main"; if (htmlElement.readAttribute('data-xwiki-space')) { // HTML 5 attribute Index: xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/meta.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/meta.js (revision f926854c3a1a78a8f5c47e7b5e72748d07cdcc8e) +++ xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/meta.js (revision ) @@ -18,15 +18,21 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ define(['jquery'], function($) { + // Note: Starting with XWiki 7.2M3, the returned "document", "xwiki", "space" and "page" variables are deprecated + // and it's recommended to use the new "reference" variable, which holds the full String reference of the current + // document. + // In addition starting with XWiki 7.2M1, the "space" variable now holds the full space reference (i.e. one or + // several spaces separated by dots, e.g. "space1.space2"). var html = $('html'); // Case 1: meta information are stored in the data- attributes of the tag // (since Flamingo) if (html.data('xwiki-document') !== undefined) { return { - 'document': html.data('xwiki-document'), - 'wiki': html.data('xwiki-wiki'), - 'space': html.data('xwiki-space'), - 'page': html.data('xwiki-page'), + 'reference': html.data('xwiki-reference'), + 'document': html.data('xwiki-document'),// deprecated + 'wiki': html.data('xwiki-wiki'),// deprecated + 'space': html.data('xwiki-space'),// deprecated + 'page': html.data('xwiki-page'),// deprecated 'version': html.data('xwiki-version'), 'restURL': html.data('xwiki-rest-url'), 'form_token': html.data('xwiki-form-token') @@ -35,7 +41,7 @@ // Case 2: meta information are stored in deprecated tags // (in colibri) var metaTags = $('meta'); - var lookingFor = ['document', 'wiki', 'space', 'page', 'version', 'restURL', 'form_token']; + var lookingFor = ['reference', 'document', 'wiki', 'space', 'page', 'version', 'restURL', 'form_token']; var results = {} for (var i = 0; i < metaTags.length; ++i) { var metaTag = $(metaTags[i]); Index: xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/htmlheader.vm IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/htmlheader.vm (revision f926854c3a1a78a8f5c47e7b5e72748d07cdcc8e) +++ xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/htmlheader.vm (revision ) @@ -11,10 +11,16 @@ data-xwiki-${name}="$escapetool.xml($value)" #end