• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4378: default skin, and thus the classic skin, contains javascript

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   minor  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

There are a couple of things that speak against this begin the right approach - I hope we can undo it before we release 4.2.

  1. we'd like the base skin that all other skins can be based on not pre-suppose what javascript libraries are going to be used
  2. if possible, the base skin should be fully functional without JS (mmm, and css really)
This is not to suggest that default skin should not contain the css class and id specifications, just that they should not be activly used in the default skin, or in the classic skin.

What I was thinking, is that there would be over-ride skins that could be wedged between default skin, and the implementation skin (such as pattern, moveabletype, nat) that would add the javascript functionalities.

This would result in a defaulttwikiJS skin (using the TWiki:Plugins/TWikiJavascript libraries), and a defaultjQuery skin - using jQuery, and a defaultYUI skin.... etc

all of which could be chosen by selecting them as the middleman in the SKIN setting....

thus I would use Set SKIN =defaultYUI, moveabletype , Arthur would use Set SKIN =defaulttwikiJS, pattern and Micha would do.. Set SKIN =defaultjQuery, nat

-- TWiki:Main/SvenDowideit - 18 Jul 2007

I don't know if this is the right approach - I leave that to the skinners - but I definitely don't want to see JS in the default templates if we can possible avoid it. It makes certain types of skinning so much harder. On the other hand, I do believe in CSS in the default templates; just because I can't imagine not wanting it.

-- TWiki:Main.CrawfordCurrie - 18 Jul 2007

The reason I put the javascript include in was that we already have javascript to show popups, and to select/deselect checkboxes. This seems basic functionality to me. I further wanted to provide a clean solution to this using BehaviourContrib, but that is on hold (adding features).

The suggested approach using a javascript skin would mean:

  1. the skin must assume the javascript is there
  2. the inclusion happens outside of the skin, using the skin path
I have a problem with this, it makes it too easy to break. Skin paths are not that intuitive. As alternative approach I suggest:
  • put all javascript in a javascript.tmpl template
  • create modules default, edit, etcetera that are called in the other templates. For instance:
    %TMPL:DEF{"javascript:template"}%%TMPL:P{"javascript:edit"}%%TMPL:END%
    
Subskins would redefine the javascript template, like javascript.pattern.tmpl, javascript.moveabletype.tmpl and write different includes and modules.

-- TWiki:Main.ArthurClemens - 18 Jul 2007

I'm worry that the time to render a topic may increase as the number of templates needed to render a page increases.

-- TWiki:Main.RafaelAlvarez - 18 Jul 2007

Rafael - it does - as my blog post from early this year shows. But its also a trivial thing to fix using caching.

What we won't be able to fix later, is the ability of other users to not use the javascript that Arthur has written for pattern skin, that has been pushed down into the default skin.

I'm not sure about the javascript.tmpl approach either, and It has no place in the default skin, which needs to defer those sorts of choices to other layers of abstraction.

We need to make it possible for others to create non-javascript skins, and to do this, they should be able to inherit from default.

-- TWiki:Main.SvenDowideit - 18 Jul 2007

The javascript.tmpl existed before but gotwas lost along the current dev cycle. Please, let's have it back.

-- TWiki:Main.MichaelDaum - 18 Jul 2007

What is wrong about having a default javascript.tmpl that can be overridden by subskins? Enough layer for me.

-- TWiki:Main.ArthurClemens - 18 Jul 2007

if used, javascript.tmpl could have empty "hookup points" that other skins can override.

-- TWiki:Main.RafaelAlvarez - 18 Jul 2007

yes, you could have a javascript.tmpl that was just a lot of empty hook points.... but I'm not sure there's much need for that. you can create the 'hooks' (the %!TMPL:P{}%) without needing to actually have a javascript.tmpl.

Then in a skin that defines and uses Javascript, the necessary =%TMPL:DEF%='s would be defineable.

on the other hand, my work on MoveableType skin shows that it is quite possible to have all those customisations in twiki.skin.tmpl.

so long as the default skin, and presumable classic, don't load any js files, and don't call any js, I'm not actually trying to say it must be done with or without javascript.tmpl. I've not spent enough time examining the consequenses of either choice to know which is better.

-- TWiki:Main.SvenDowideit - 18 Jul 2007

twiki.tmpl has 2 hooks inside module script:

  • skinscript
  • templatescript
It really doesn't matter if this is written in twiki.tmpl or in javascript.tmpl. The easiest way now would be to put all script includes in skinscript. Or leave it empty in case default skin should not use any javascript. Subskins can redefine module skinscript.

-- TWiki:Main.ArthurClemens - 18 Jul 2007

Arthur, what are skinscript and templatescript used for? These macros may deserve better names reflecting their use. skin - template, these two things are too close to each other.

-- TWiki:Main.MichaelDaum - 19 Jul 2007

  • skinscript: skin (overall) specific script, perhaps using YUI or the TWikiJavascripts. To cater for what Sven described above.
  • templatescript: template specific script - edit needs different code than rename or view
-- TWiki:Main.ArthurClemens - 19 Jul 2007

one of the complaints I've seen wrt to the skinning system is that there are simply too many tmpl files, many of which contain very little.

to improve this, I tried to reduce it to having one tmpl file per twikiaction, the messages.tmpl, and a twiki.tmpl file that contains the common defines.

If at all possible, please keep the umber of files in the default skin low - which reminds me, we need to add docco to each fiile, and to each TMPL:DEF, so its not just us that know what they do, and when they are used.

-- TWiki:Main.SvenDowideit - 19 Jul 2007

Arthur, does this still require work? (Sven is not here to ask)

CC

It would be good to reach an agreement on what needs to be done soon, so eventual refactorings can go in the beta release.

-- TWiki:Main.SteffenPoulsen - 20 Aug 2007

We need a better solution. There is still a kludge with an overriding subskin. So yes, it needs some more work.

-- TWiki:Main.ArthurClemens - 20 Aug 2007

I have removed all except for the most essential javascript from the default templates. Still included are:

  • popup-windows
  • select all checkboxes
I have also created/renamed these 3 javascript container DEFs:
  • script:skinbase - the base javascript used throughout the skin
  • script:skintemplate - the javascript used in specific templates, for instance in the edit template only
  • script:topictemplate - javascript used in topic templates
These 3 containers are layered in this order.

-- ArthurClemens - 30 Aug 2007

ItemTemplate
Summary default skin, and thus the classic skin, contains javascript
ReportedBy TWiki:Main.SvenDowideit
Codebase ~twiki4
SVN Range TWiki-4.1.2, Tue, 17 Jul 2007, build 14423
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:14669 TWikirev:14672 TWikirev:14673 TWikirev:14674 TWikirev:14675
TargetRelease minor
ReleasedIn

Edit | Attach | Watch | Print version | History: r27 < r26 < r25 < r24 < r23 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r27 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback