Skip to content

Commit

Permalink
Merge remote-tracking branch 'wet-boew/v3.0' into feature-table-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
duboisp committed Oct 17, 2012
2 parents 3cd1151 + 425e474 commit 66de2f3
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 71 deletions.
7 changes: 4 additions & 3 deletions .gitignore
@@ -1,8 +1,8 @@
nbproject/*
.sass-cache/
.DS_Store
jruby.jar
build/lib/vendors
jruby*.jar
build/lib/vendors*
build/lib/jruby-compiled
_notes/

Expand All @@ -16,4 +16,5 @@ ethumbs.db
Thumbs.db
/.project
jshint.out.xml
*.orig
*.orig
*.tmp
34 changes: 1 addition & 33 deletions build/README.md
@@ -1,35 +1,3 @@
# Building the Web Experience Toolkit (WET)

[![Build Status](https://secure.travis-ci.org/wet-boew/wet-boew.png?branch=master)](http://travis-ci.org/wet-boew/wet-boew)

Web Experience Toolkit (WET) uses Ant(1.8+), JRuby(1.6.7.2), YUI Compressor, and several Ruby gems.

## Windows

* Ant: download from [Apache](http://ant.apache.org) and extract to C:\ant
* Java JDK: download from [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html) if your current installation doesn't meet the minimum stated by "[Which version of Java is required to run Apache Ant?"](http://ant.apache.org/faq.html#java-version)
* open a command prompt to the root directory and run:
> build.cmd
### *nix (OS X, Linux)

* Ant: many distributions come with a verions of Ant, but ensure that a version later than 1.8 is installed by running the following at the terminal:
> ant -version
* open a shell to the root directory and run:
> ant
## Proxy Issues
The build will download several files during the first build so those behind restrictive firewalls may encounter issues.
You will need to set your proxy information in the ANT_OPTS environmental variable. See the [Ant Proxy manual](http://ant.apache.org/manual/proxy.html) for further information.

* On Windows you can use the build.cmd to set the ANT_OPTS variable:
> build.cmd -Dhttp.proxyHost=PROXY -Dhttp.proxyPort=PORT

* If issues are still encountered, you may manually download the required files to their expected location before running Ant.
1. [jRuby](http://jruby.org.s3.amazonaws.com/downloads/1.6.7.2/jruby-complete-1.6.7.2.jar) to build/lib and rename it jruby-download.jar
2. Create the folder build/lib/jruby-compiled and copy the gems inside with version number removed from the file name
* [sass.gem](http://production.cf.rubygems.org/gems/sass-3.1.19.gem)
* [chunky_png.gem](http://production.cf.rubygems.org/gems/chunky_png-1.2.5.gem)
* [fssm.gem](http://production.cf.rubygems.org/gems/fssm-0.2.9.gem)
* [compass.gem](http://production.cf.rubygems.org/gems/compass-0.12.1.gem)
https://github.com/wet-boew/wet-boew/wiki/Developing-for-WET#wiki-Building_WET
11 changes: 10 additions & 1 deletion build/build-tasks.properties
Expand Up @@ -12,7 +12,16 @@ antcontribs.jar=${lib.dir}/ant-contrib-1.0b3.jar
cssurlembed.jar=${lib.dir}/cssembed-0.4.5.jar

#jRuby Properties
jruby.jar=${lib.dir}/jruby.jar
jruby.depends=1.0.0
jruby.jar=jruby-v${jruby.depends}.jar
jruby.version=1.6.7.2

#Gems
gem.dir=${lib.dir}/jruby-compiled
sass.gem=sass-3.1.19.gem
chunky_png.gem=chunky_png-1.2.5.gem
fssm.gem=fssm-0.2.9.gem
compass.gem=compass-0.12.1.gem

#JSLint
jshint.jar=${lib.dir}/ant-jshint-0.3.1-deps.jar
Expand Down
33 changes: 17 additions & 16 deletions build/build-tasks.xml
Expand Up @@ -42,31 +42,32 @@
<!-- Include the compiled jruby.jar file -->
<path id="jruby.classpath">
<fileset dir="${lib.dir}">
<include name="jruby*.jar"/>
<include name="${jruby.jar}"/>
</fileset>
</path>
</path>

<!-- Include jruby + gems (compass + sass) -->
<target name="-build-jruby" depends="-jruby.jar.check" unless="jruby.jar.exists">
<mkdir dir="${lib.dir}/jruby-compiled" />
<get src="http://jruby.org.s3.amazonaws.com/downloads/1.6.7.2/jruby-complete-1.6.7.2.jar" dest="${lib.dir}/jruby-download.jar" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/sass-3.1.19.gem" dest="${lib.dir}/jruby-compiled/sass.gem" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/chunky_png-1.2.5.gem" dest="${lib.dir}/jruby-compiled/chunky_png.gem" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/fssm-0.2.9.gem" dest="${lib.dir}/jruby-compiled/fssm.gem" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/compass-0.12.1.gem" dest="${lib.dir}/jruby-compiled/compass.gem" skipexisting="true"/>
<java jar="${lib.dir}/jruby-download.jar" fork="true">
<arg line="-S gem install -i &quot;${lib.dir}/vendors&quot; &quot;${lib.dir}/jruby-compiled/sass.gem&quot; &quot;${lib.dir}/jruby-compiled/chunky_png.gem&quot; &quot;${lib.dir}/jruby-compiled/fssm.gem&quot; &quot;${lib.dir}/jruby-compiled/compass.gem&quot;"/>
<delete dir="${lib.dir}/vendors-${jruby.depends}" />
<get src="http://jruby.org.s3.amazonaws.com/downloads/${jruby.version}/jruby-complete-${jruby.version}.jar" dest="${lib.dir}/jruby-complete-${jruby.version}.jar" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/${sass.gem}" dest="${gem.dir}/${sass.gem}" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/${chunky_png.gem}" dest="${gem.dir}/${chunky_png.gem}" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/${fssm.gem}" dest="${gem.dir}/${fssm.gem}" skipexisting="true"/>
<get src="http://production.cf.rubygems.org/gems/${compass.gem}" dest="${gem.dir}/${compass.gem}" skipexisting="true"/>
<java jar="${lib.dir}/jruby-complete-${jruby.version}.jar" fork="true">
<arg line="-S gem install -i &quot;${lib.dir}/vendors-${jruby.depends}&quot; &quot;${gem.dir}/${sass.gem}&quot; &quot;${gem.dir}/${chunky_png.gem}&quot; &quot;${gem.dir}/${fssm.gem}&quot; &quot;${gem.dir}/${compass.gem}&quot;"/>
</java>
<exec executable="jar" dir="${lib.dir}/">
<arg line="-uf jruby-download.jar -C vendors ." />
<arg line="-uf jruby-complete-${jruby.version}.jar -C vendors-${jruby.depends} ." />
</exec>
<move file="${lib.dir}/jruby-download.jar" tofile="${lib.dir}/jruby.jar"/>
<delete dir="${lib.dir}/jruby-compiled" />
<move file="${lib.dir}/jruby-complete-${jruby.version}.jar" tofile="${lib.dir}/${jruby.jar}"/>
<delete dir="${gem.dir}" />
</target>

<target name="-jruby.jar.check">
<condition property="jruby.jar.exists">
<available file="${lib.dir}/jruby.jar" type="file"/>
<available file="${lib.dir}/${jruby.jar}" type="file"/>
</condition>
</target>

Expand All @@ -81,7 +82,7 @@
<target name="call.sass">
<java classname="org.jruby.Main" fork="true" failonerror="true" classpathref="jruby.classpath">
<arg path="${tasks.basedir}/compile.rb"/>
<arg path="${lib.dir}/vendors/gems/"/>
<arg path="${lib.dir}/vendors-${jruby.depends}/gems/"/>
<arg value="${command}"/>
<arg path="${src.dir}"/>
</java>
Expand Down
2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions src/js/pe-ap.js
Expand Up @@ -861,7 +861,7 @@
if (tagName === heading) {
hlink = $this.children('a');
navCurrent = hlink.hasClass('nav-current');
subsection = $('<div data-role="collapsible"' + ((expand && !menubar) || navCurrent ? ' data-collapsed="false"' : '') + (navCurrent ? ' class="nav-current"' : '') + '>' + headingOpen + $this.text() + headingClose + '</div>');
subsection = $('<div data-role="collapsible"' + ((expand && !menubar) || navCurrent ? ' data-collapsed="false" data-theme="' + theme1 + '"' : '') + (navCurrent ? ' class="nav-current"' : '') + '>' + headingOpen + $this.text() + headingClose + '</div>');
next = $this.next();
if (next.get(0).tagName.toLowerCase() === 'ul') {
// The original menu item was not in a menu bar
Expand All @@ -879,7 +879,7 @@
// Make the nested list into a collapsible section
hlink = $this.prev('a');
hlink_html = hlink[0].innerHTML;
$this.attr({ 'data-role': 'listview', 'data-theme': theme2 }).wrap('<div data-role="collapsible"' + (expand || hlink.hasClass('nav-current') ? ' data-collapsed="false"' : '') + '></div>');
$this.attr({ 'data-role': 'listview', 'data-theme': theme2 }).wrap('<div data-role="collapsible"' + (expand || hlink.hasClass('nav-current') ? 'data-collapsed="false" data-theme="' + theme2 + '"' : '') + '></div>');
$this.parent().prepend(headingIndexOpen + hlink_html + headingIndexClose);
$this.append('<li><a href="' + hlink.attr('href') + '">' + hlink_html + ' - ' + mainText + '</a></li>');
hlink.remove();
Expand All @@ -888,7 +888,7 @@
}
});
subsection.append($(listView).append(next.children('li')));
if (nested.length > 0) {
if (!expand && nested.length > 0) {
subsection.find('ul').wrap(collapsibleSet);
}
} else { // If the section contains sub-sections
Expand All @@ -898,7 +898,7 @@
subsection.append(pe.menu.buildmobile($this.parent(), hlevel + 1, theme1, false, expand, theme2, false));
}
// If the original menu item was not in a menu bar
if (!menubar) {
if (!menubar && !expand) {
subsection.find('div[data-role="collapsible-set"]').eq(0).append($this.children('a').html(hlink[0].innerHTML + ' - ' + mainText).attr({'data-role': 'button', 'data-theme': theme2, 'data-icon': 'arrow-r', 'data-iconpos': 'right', 'data-corners': 'false'}));
}
}
Expand All @@ -914,7 +914,9 @@
}
}
});
menu.children().wrapAll('<div data-role="collapsible-set" data-inset="false" data-theme="' + theme1 + '"></div>');
if (toplevel || !expand) {
menu.children().wrapAll('<div data-role="collapsible-set" data-inset="false" data-theme="' + theme1 + '"></div>');
}
}
}
return menu;
Expand Down
43 changes: 31 additions & 12 deletions src/js/workers/deselectradio.js
Expand Up @@ -16,23 +16,42 @@
type : 'plugin',
depends : [],
_exec : function (elm) {
var radio = $('input[type="radio"]:not(.deselectable, .deselect-off)').attr('role', 'radio').attr('aria-checked', 'false').addClass('deselectable');
radio.filter(':checked').attr('aria-checked', 'true');
radio.closest('fieldset').attr('role', 'radiogroup');
radio.on("click vclick", function () {
var $this = $(this);
if ($this.attr('aria-checked') === 'true') {
$this.prop('checked', false).attr('aria-checked', 'false');
} else {
$this.closest('fieldset').find('input[type="radio"]').prop('checked', false).attr('aria-checked', 'false');
$this.prop('checked', true).attr('aria-checked', 'true');
var inputs = document.getElementsByTagName('input'),
inputs_len = inputs.length,
input;
// Functionality can be disabled by applying deselect-off to the radio button
while (inputs_len--) {
input = inputs[inputs_len];
if (input.type === 'radio' && input.className.indexOf('deselect-off') === -1) {
input.className += ' deselectable' + (input.checked ? ' checked' : '');
}
}
$(document).on('click vclick', 'input[type="radio"].deselectable', function () {
if (this.className.indexOf(' checked') !== -1) { // Already selected so deselect and remember that it is no longer selected
this.checked = false;
this.className = this.className.replace(' checked', '');
} else { // Not selected previously so remember that it is now selected
var name = this.getAttribute('name'),
inputs,
input,
inputs_len;
if (name !== undefined) {
inputs = document.getElementsByName(name);
inputs_len = inputs.length;
while (inputs_len--) {
input = inputs[inputs_len];
if (input.className.indexOf(' checked') !== -1) {
input.className = input.className.replace(' checked', '');
}
}
this.className += ' checked';
}
}
});

return elm;
} // end of exec
};
window.pe = _pe;
return _pe;
}
(jQuery));
(jQuery));

0 comments on commit 66de2f3

Please sign in to comment.