On Sep 20, 2012, at 3:43 PM, Marius Dumitru Florea 
<[email protected]> wrote:

> On Wed, Sep 19, 2012 at 1:25 PM, Jerome@home
> <[email protected]> wrote:
>> Hello guys
>> first sorry for my english wich is not as good as i would ;)
>> I'm a newbee on xwiki (but i know html), in fact i'm an end-user and i can
>> only acces to the wysiwyg and the source on the xwiki pages (not the admin)
>> BUT i need to use a CSS on some one.
>> I try to put my css file as an attached file of my xwiki page, and using
>> this command-line on the source code:
>> {{velocity}}
>> $xwiki.ssfx.use('bin/download/Space_test/testcss/csstable.css', true)
>> {{/velocity}}
>> or this one:
>> {{velocity}}
>> $xwiki.ssx.use('csstable.css')
>> {{/velocity}}
>> but it always looking for the file "csstable" in the directory
>> skin/albatross or ssx.
>> 
>> Is there any solution that's make the file "csstable.css" loading into the
>> right directory (even if it's an external link to another server) or any
>> other workaround (in fact, i've got several tables on my xwiki page, and i
>> don't want to use, each time, the source code to edit the css of each td)?!
>> I know that it will be more usefull if the admin of the xwiki could change
>> this css, but i'm not sure he would like.
> 
> Currently it's not possible to load as skin extension a CSS/JavaScript
> file that is attached to a wiki page. If the file is not very big you
> can paste its content in a skin extension object. See
> http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial

Well it's possible with a a trick… 

Here's an example:

/* Inject an extra javascript script tag into the current DOM using the given 
script location/source. */
var importScript = function(src) {
  var script_tag = document.createElement('script');
  script_tag.type = "text/javascript";
  script_tag.src = src;

  document.getElementsByTagName('head')[0].appendChild(script_tag);
}

#set ($attachmentName = 'codemirror.zip')
importScript("$xwiki.zipexplorer.getFileLink($doc, $attachmentName, 
'lib/util/match-highlighter.js')");

-Vincent

> .Hope this helps,
> Marius

_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to