Wolfram Schneider [Wed, 7 May 2014 14:25:14 +0000 (14:25 +0000)]
Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws
Wolfram Schneider [Wed, 7 May 2014 14:15:38 +0000 (14:15 +0000)]
trailing comma breaks IE8
found by google closure-compiler
Mike Taylor [Wed, 7 May 2014 13:16:03 +0000 (14:16 +0100)]
Container widgets get a default null implementation to avoid log-splurging.
Mike Taylor [Wed, 7 May 2014 12:30:50 +0000 (13:30 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:30:41 +0000 (13:30 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:30:23 +0000 (13:30 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:30:14 +0000 (13:30 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:30:03 +0000 (13:30 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:29:54 +0000 (13:29 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:29:42 +0000 (13:29 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:29:23 +0000 (13:29 +0100)]
Tabs to spaces.
Mike Taylor [Wed, 7 May 2014 12:28:04 +0000 (13:28 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:22:11 +0000 (13:22 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:21:56 +0000 (13:21 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:21:46 +0000 (13:21 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:21:40 +0000 (13:21 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:20:02 +0000 (13:20 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:19:54 +0000 (13:19 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:19:45 +0000 (13:19 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:19:31 +0000 (13:19 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:19:02 +0000 (13:19 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:18:44 +0000 (13:18 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:17:08 +0000 (13:17 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:16:48 +0000 (13:16 +0100)]
Re-indent.
Mike Taylor [Wed, 7 May 2014 12:16:17 +0000 (13:16 +0100)]
Re-indent.
Mike Taylor [Tue, 6 May 2014 15:47:54 +0000 (16:47 +0100)]
Whitespace
Mike Taylor [Tue, 6 May 2014 15:47:04 +0000 (16:47 +0100)]
Whitespace
Mike Taylor [Fri, 2 May 2014 16:43:39 +0000 (17:43 +0100)]
Merge the two(!) definitions of Results widget.
The new one (generate internal HTML) was overriding the old one (set
up notifications of autosearch events), so that autosearch no longer
worked on Results widgets. (We didn't notice because most autosearch
demos use Records widgets.)
Mike Taylor [Fri, 2 May 2014 16:10:03 +0000 (17:10 +0100)]
Move code to set language from command line out of mkws-team.js into
mkws-core.js
Mike Taylor [Fri, 2 May 2014 16:02:51 +0000 (17:02 +0100)]
Reorder functions.
Mike Taylor [Fri, 2 May 2014 16:02:17 +0000 (17:02 +0100)]
The switchview show/hide is done using jQuery rather than directly
messing with the CSS.
Mike Taylor [Fri, 2 May 2014 15:56:11 +0000 (16:56 +0100)]
Move the M function (translation) from mkws-team.js to mkws-core.js,
since it's not team-specific (and never really was).
Mike Taylor [Fri, 2 May 2014 15:54:39 +0000 (16:54 +0100)]
In fact, remove the local alias M completely, since it's not used!
Mike Taylor [Fri, 2 May 2014 15:51:54 +0000 (16:51 +0100)]
Delete obsolete comment.
Mike Taylor [Fri, 2 May 2014 15:51:37 +0000 (16:51 +0100)]
mkws.M is defined, and M made a local alias for it, rather than the
other way around. Again, this is just about being honest.
Mike Taylor [Fri, 2 May 2014 15:50:14 +0000 (16:50 +0100)]
Language-setting code also honestly uses mkws.config.lang instead of m_config.lang.
Mike Taylor [Fri, 2 May 2014 15:46:01 +0000 (16:46 +0100)]
The M function (translation) looks up mkws.config.lang rather than
m_config.lang. Doing the latter was lie, since this function gets
called as mkws.M much of the time, and so gets a randomly chosen
team's lang setting; and all teams always have the same lang setting
anyway, since there's no way to set it differently per team.
Mike Taylor [Fri, 2 May 2014 15:36:32 +0000 (16:36 +0100)]
Remove obsolete comment.
Mike Taylor [Fri, 2 May 2014 15:10:42 +0000 (16:10 +0100)]
The team-private findnode function is no longer made visible as the
team.findnode method. It's not actually been used for a while now,
since widgets know their own nodes. Its continued existence is a bit
of an embarrassment for various reasons, including its knowledge of
how "AUTO" is special and the extremely complex jQuery selectors is
generates in some cases. It would be good to get rid of it completely,
but it's presently (ab)used for full-record display. Is there a good
way to widgetify that?
Mike Taylor [Fri, 2 May 2014 14:04:10 +0000 (15:04 +0100)]
Prefix names of all Handlebars helpers with "mkws-":
mkws-json
mkws-paragraphs
mkws-translate
mkws-attr
mkws-if-any
mkws-first
mkws-commaList
mkws-index1
This fixes MKWS-172 ("Prefix Handlebars helpers"), which OK was only a
P5, but it irritated my sense of neatness having a P5 hanging around
in the MKWS area with all the good bugs.
Mike Taylor [Thu, 1 May 2014 16:03:31 +0000 (17:03 +0100)]
Tweak name of resize-narrow/resize-wide events (now including a hyphen).
Remove old hardwired hide/show code depending on list.
Mike Taylor [Thu, 1 May 2014 16:02:02 +0000 (17:02 +0100)]
Switch and Lang widgets hide themselves when the window is narrow.
Mike Taylor [Thu, 1 May 2014 16:01:37 +0000 (17:01 +0100)]
New widget-setup utility function, hideWhenNarrow.
Teaches the widget to disappear when the window changes from wide to
narrow, and reappear when it changes from narrow to wide.
Mike Taylor [Thu, 1 May 2014 15:48:43 +0000 (16:48 +0100)]
Document mkwsTermlists-Container-* instead of mkwsTermlist-Container-*
Mike Taylor [Thu, 1 May 2014 15:48:33 +0000 (16:48 +0100)]
Generate mkwsTermlists-Container-* instead of mkwsTermlist-Container-*
Mike Taylor [Thu, 1 May 2014 15:01:17 +0000 (16:01 +0100)]
Generalise the moving as well as the hiding.
Mike Taylor [Thu, 1 May 2014 14:59:28 +0000 (15:59 +0100)]
Set up resize-aware containers for mkwsSearch.
Mike Taylor [Thu, 1 May 2014 14:59:06 +0000 (15:59 +0100)]
team.widget returns undefined is there are no widgets of the specified type.
Mike Taylor [Thu, 1 May 2014 14:58:41 +0000 (15:58 +0100)]
Silly typo.
Mike Taylor [Thu, 1 May 2014 14:44:30 +0000 (15:44 +0100)]
Rip out special-case code for moving Termlists between
Termlist-Container-wide and Termlist-Container-narrow; replace it with
general code that will re-position ANY widget between two different
containers on a narrowing or widening event.
Mike Taylor [Thu, 1 May 2014 14:01:00 +0000 (15:01 +0100)]
Widget facets now render (using toString) with the facet-name included.
Mike Taylor [Thu, 1 May 2014 13:52:32 +0000 (14:52 +0100)]
The m_widgets private member, which maps widget-type to wiget object,
now maps to an array of widgets of that type. For most types of
widget, only one instance per team makes sense, so the team.widget
method now complains loudly if it's invoked for a type that has more
than one instance -- client code should never do that. visitWidgets
now visits all widgets of the specified type.
Mike Taylor [Thu, 1 May 2014 13:40:05 +0000 (14:40 +0100)]
Less verbose logging when a widget makes new HTML on creation.
Mike Taylor [Thu, 1 May 2014 13:09:30 +0000 (14:09 +0100)]
Change commenting type for team->widgets logging walk.
Mike Taylor [Thu, 1 May 2014 13:08:53 +0000 (14:08 +0100)]
Commented-out code to walk team->widgets structure uses visitWidgets
Mike Taylor [Thu, 1 May 2014 13:08:24 +0000 (14:08 +0100)]
Remove lumped team.widgetTypes method with more functional visitWidgets.
Mike Taylor [Thu, 1 May 2014 11:35:26 +0000 (12:35 +0100)]
Add tmp
Mike Taylor [Thu, 1 May 2014 11:24:46 +0000 (12:24 +0100)]
Tweak resizePage so that is does the appropriate actions on its very
first call. As a result, we now initially display the narrow version
when viewing in narrow window.
Mike Taylor [Thu, 1 May 2014 11:10:49 +0000 (12:10 +0100)]
resizePage now use team.widget method to find widgets to show/hide.
This works correctly when the implicit AUTO team is used.
Mike Taylor [Thu, 1 May 2014 09:26:30 +0000 (10:26 +0100)]
Transform resizePage function so the actual work is done only once,
the same code for narrowing and widening.
Mike Taylor [Wed, 30 Apr 2014 15:54:33 +0000 (16:54 +0100)]
Consolidate both narrow/wide clauses.
Mike Taylor [Wed, 30 Apr 2014 15:53:31 +0000 (16:53 +0100)]
Rename targetWidth -> threshhold.
Mike Taylor [Wed, 30 Apr 2014 15:53:02 +0000 (16:53 +0100)]
Swap order of logging clauses.
Mike Taylor [Wed, 30 Apr 2014 15:52:51 +0000 (16:52 +0100)]
Remove the "already wide" and "already narrow" logging.
Mike Taylor [Wed, 30 Apr 2014 15:51:49 +0000 (16:51 +0100)]
Detection of wide/narrow state changes is now done on the basis of the
stored mkws.width rather than the presence of absence of known magic
elements.
Mike Taylor [Wed, 30 Apr 2014 15:49:36 +0000 (16:49 +0100)]
Add logging of size state-changes.
Mike Taylor [Wed, 30 Apr 2014 15:41:45 +0000 (16:41 +0100)]
Add new temporary variable width in resizePage function.
Mike Taylor [Wed, 30 Apr 2014 15:40:48 +0000 (16:40 +0100)]
Rename variable width->targetWidth in resizePage function.
Mike Taylor [Wed, 30 Apr 2014 15:35:05 +0000 (16:35 +0100)]
resizePage() publishes "resize-narrow" and "resize-wide" events.
This will allow individual widgets to respond to size-changes.
Mike Taylor [Wed, 30 Apr 2014 15:18:54 +0000 (16:18 +0100)]
Use mkwsTermlist-container-wide and -narrow instead of mkwsTermlistContainer1 and 2, part of a new general scheme
Mike Taylor [Wed, 30 Apr 2014 15:18:13 +0000 (16:18 +0100)]
Add responsive_design_width.
Mike Taylor [Wed, 30 Apr 2014 10:59:41 +0000 (11:59 +0100)]
Fix embedded stylesheet of heikki-motd.html to address by class rather than ID.
Mike Taylor [Wed, 30 Apr 2014 10:59:20 +0000 (11:59 +0100)]
Fix embedded stylesheet of heikki.html to address by class rather than ID.
Mike Taylor [Wed, 30 Apr 2014 10:57:01 +0000 (11:57 +0100)]
Add null widget definitions for Query, MOTDContainer, Button and Popup.
These are all used in the code, but have no functionality of their own.
Mike Taylor [Wed, 30 Apr 2014 09:55:30 +0000 (10:55 +0100)]
Comment out the addWidget logging.
Mike Taylor [Wed, 30 Apr 2014 09:55:16 +0000 (10:55 +0100)]
Change wording of addWidget function's logging.
Mike Taylor [Wed, 30 Apr 2014 08:14:25 +0000 (09:14 +0100)]
Test scripts pull in new mkws-widget.js and mkws-widget-main.js rather than old mkws-widgets.js
Mike Taylor [Wed, 30 Apr 2014 08:06:02 +0000 (09:06 +0100)]
COMPONENTS now includes mkws-widget.js (for the widget factory
function and shared autosearch functionality) and mkws-widget-main.js
(for the main widgets' definitions) in place of the old and
over-monolithic mkws-widgets.js
Mike Taylor [Wed, 30 Apr 2014 08:03:10 +0000 (09:03 +0100)]
Rename mkws-widgets.js to mkws-widget-main.js
Mike Taylor [Wed, 30 Apr 2014 08:02:45 +0000 (09:02 +0100)]
Move widget factory function and autosearch functionality out of
mkws-widgets.js into their own new file mkws-widget.js
Mike Taylor [Wed, 30 Apr 2014 08:01:34 +0000 (09:01 +0100)]
New file, mkws-widget.js: contains wiget factory function and
autosearch code from the old mkws-widgets.js.
Mike Taylor [Tue, 29 Apr 2014 15:24:21 +0000 (16:24 +0100)]
Remove not-necessary-after-all newline.
Mike Taylor [Tue, 29 Apr 2014 15:24:00 +0000 (16:24 +0100)]
Rename reference-universe.html to reference.html, since the widget it defines and uses is not after all the one that MKWS-156 wants
Mike Taylor [Tue, 29 Apr 2014 15:17:51 +0000 (16:17 +0100)]
Use as testbed for Reference widget.
Mike Taylor [Tue, 29 Apr 2014 15:17:00 +0000 (16:17 +0100)]
Use new Handlebars helper, "paragraphs", to render md-description.
Mike Taylor [Tue, 29 Apr 2014 15:16:36 +0000 (16:16 +0100)]
Add new Handlebars helper, "paragraphs".
Mike Taylor [Tue, 29 Apr 2014 14:00:39 +0000 (15:00 +0100)]
Whitespace.
Mike Taylor [Tue, 29 Apr 2014 12:56:44 +0000 (13:56 +0100)]
Add MOTD
Mike Taylor [Tue, 29 Apr 2014 12:56:20 +0000 (13:56 +0100)]
Inline the code of function mkwsSetLang, which is now gone.
Mike Taylor [Tue, 29 Apr 2014 12:54:54 +0000 (13:54 +0100)]
Oops, remove the spurious alert() from the MOTD widget!
Mike Taylor [Tue, 29 Apr 2014 12:53:55 +0000 (13:53 +0100)]
Remove unused return from end of mkwsSetLang
Mike Taylor [Tue, 29 Apr 2014 12:53:14 +0000 (13:53 +0100)]
Move function mkwsSetLang() to the end of the team object, where it's used.
Mike Taylor [Tue, 29 Apr 2014 12:52:25 +0000 (13:52 +0100)]
function mkwsHtmlAll is GONE!
I think we may now be fully widgeted.
Mike Taylor [Tue, 29 Apr 2014 12:51:57 +0000 (13:51 +0100)]
Add MOTD widget.
Mike Taylor [Tue, 29 Apr 2014 12:46:04 +0000 (13:46 +0100)]
Remove unused "none" case from switchView.
Mike Taylor [Tue, 29 Apr 2014 12:44:32 +0000 (13:44 +0100)]
Move the defaultTemplate function, which was never team-specific, up into the MKWS global core
Mike Taylor [Tue, 29 Apr 2014 12:41:24 +0000 (13:41 +0100)]
Call mkwsSetLang separately from mkwsHtmlAll.
Mike Taylor [Tue, 29 Apr 2014 12:39:44 +0000 (13:39 +0100)]
Rip out the mkwsHtmlLang and lang_url functions.
Mike Taylor [Tue, 29 Apr 2014 12:39:14 +0000 (13:39 +0100)]
Lang widget now generates its own HTML
Mike Taylor [Tue, 29 Apr 2014 12:32:18 +0000 (13:32 +0100)]
Move show_lang logic inside mkwsHtmlLang.