[xwiki-users] WYSIWYG editor link function cannot work
I update XWIKI from 1.1 to 1.8 and I need to keep some VM. All JS files are imported into the editor and it seems all functions are correct except the "link" ->"wiki page". When I click "link" -> "wiki page" shown below: http://n2.nabble.com/file/n3254443/image001.png It always showing "Loading data……", see the screenshot below: http://n2.nabble.com/file/n3254443/image003.png I find the problem is some code cannot be parsed: https://www.denver.com/xwiki/bin/edit/Test/$request.getContextPath()/rest/wi... The italic words are contents cannot be parsed. The right URL should be:http://www.denver.com/xwiki/rest/wikis/xwiki/spaces?r=788517 I think $request.getContextPath() should be parsed to: http://www.denver.com/xwiki ; and $context.getDatabase() should be parsed to: xwiki I don't know whether I am right or not. Is there anybody can point out the problem why the code cannot be parsed correctly? I will be so appreciated! -- View this message in context: http://n2.nabble.com/WYSIWYG-editor-link-function-cannot-work-tp3254443p3254... Sent from the XWiki- Users mailing list archive at Nabble.com.
ArielWang wrote:
I update XWIKI from 1.1 to 1.8 and I need to keep some VM.
Which exact version of 1.8 are you using?
All JS files are imported into the editor and it seems all functions are correct except the "link" ->"wiki page". When I click "link" -> "wiki page" shown below:
http://n2.nabble.com/file/n3254443/image001.png
It always showing "Loading data……", see the screenshot below: http://n2.nabble.com/file/n3254443/image003.png
I find the problem is some code cannot be parsed: https://www.denver.com/xwiki/bin/edit/Test/$request.getContextPath()/rest/wi... The italic words are contents cannot be parsed.
The right URL should be:http://www.denver.com/xwiki/rest/wikis/xwiki/spaces?r=788517
I think $request.getContextPath() should be parsed to: http://www.denver.com/xwiki ; and $context.getDatabase() should be parsed to: xwiki
I don't know whether I am right or not. Is there anybody can point out the problem why the code cannot be parsed correctly?
Please check in webapps/xwiki/templates/editwysiwyg.vm, around the top of the file, that you have the line: $xwiki.jsfx.use("js/xwiki/xwikiexplorer/xwikiexplorer.js", true) to include the tree javascript. Also, can you please in check Main/AllDocs, the "Tree" view (xwiki/bin/view/Main/AllDocs?view=tree), if the documents tree there loads correctly. Happy hacking, Anca
I will be so appreciated!
Anca Paula Luca wrote:
ArielWang wrote:
I update XWIKI from 1.1 to 1.8 and I need to keep some VM.
Which exact version of 1.8 are you using?
All JS files are imported into the editor and it seems all functions are correct except the "link" ->"wiki page". When I click "link" -> "wiki page" shown below:
http://n2.nabble.com/file/n3254443/image001.png
It always showing "Loading data……", see the screenshot below: http://n2.nabble.com/file/n3254443/image003.png
I find the problem is some code cannot be parsed: https://www.denver.com/xwiki/bin/edit/Test/$request.getContextPath()/rest/wi... The italic words are contents cannot be parsed.
The right URL should be:http://www.denver.com/xwiki/rest/wikis/xwiki/spaces?r=788517
I think $request.getContextPath() should be parsed to: http://www.denver.com/xwiki ; and $context.getDatabase() should be parsed to: xwiki
I don't know whether I am right or not. Is there anybody can point out the problem why the code cannot be parsed correctly?
Please check in webapps/xwiki/templates/editwysiwyg.vm, around the top of the
this was supposed to be: webapps/xwiki/templates/editwysiwygnew.vm
file, that you have the line:
$xwiki.jsfx.use("js/xwiki/xwikiexplorer/xwikiexplorer.js", true)
to include the tree javascript.
Also, can you please in check Main/AllDocs, the "Tree" view (xwiki/bin/view/Main/AllDocs?view=tree), if the documents tree there loads correctly.
Happy hacking, Anca
I will be so appreciated!
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
It's me again. As I mentioned before, $request.getContextPath() and $context.getDatabase() cannot be parsed correctly. So I changed them into fixed value in resources/js/xwiki/xwiki.js as below: /** * XWiki namespace. * TODO: move everything in it. * * @type object */ var XWiki = { constants: { /** * Current wiki. */ //currentWiki: "$context.getDatabase()", currentWiki: "xwiki", /** * Main wiki. */ mainWiki: "$context.getMainWikiName()", /** * Context path. */ //contextPath: "$request.getContextPath()", contextPath: "https://www.denver.com/xwiki" And now I can get the tree, but also one error message displayed: http://n2.nabble.com/file/n3261097/image003.jpg I have no idea about the error and the point why $request.getContextPath() and $context.getDatabase() cannot be parsed. Thanks so much! -- View this message in context: http://n2.nabble.com/WYSIWYG-editor-link-function-cannot-work-tp3254443p3261... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi, ArielWang wrote:
It's me again. As I mentioned before, $request.getContextPath() and $context.getDatabase() cannot be parsed correctly. So I changed them into fixed value in resources/js/xwiki/xwiki.js as below:
/** * XWiki namespace. * TODO: move everything in it. * * @type object */
var XWiki = {
constants: { /** * Current wiki. */ //currentWiki: "$context.getDatabase()", currentWiki: "xwiki", /** * Main wiki. */ mainWiki: "$context.getMainWikiName()",
/** * Context path. */ //contextPath: "$request.getContextPath()", contextPath: "https://www.denver.com/xwiki"
And now I can get the tree, but also one error message displayed: http://n2.nabble.com/file/n3261097/image003.jpg
You made the editor request a resource from a different domain than the one from where the editor was loaded, thus breaking the same origin policy. Is the edited page loaded using HTTPS protocol? Have you tried to set the contextPath to only "/xwiki" as told in the error message?
I have no idea about the error and the point why $request.getContextPath() and $context.getDatabase() cannot be parsed.
Check how xwiki.js is imported (look in templates/javascript.vm). It should be like this: <script type="text/javascript" src="$xwiki.getSkinFile("js/xwiki/xwiki.js", true)"></script> Notice the "true" parameter passed to the getSkinFile method. It ensures that the specified file is parsed for velocity expressions. Hope this helps, Marius
Thanks so much!
Now it works. Thank you for all the help! -- View this message in context: http://n2.nabble.com/WYSIWYG-editor-link-function-cannot-work-tp3254443p3261... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
Anca Paula Luca -
ArielWang -
Marius Dumitru Florea