Commit 4c590bd6 authored by Jon Phillips's avatar Jon Phillips
Browse files

changes

parent d7842d70
The MIT License (MIT)
Copyright (c) 2013 - Vincent Gabriel & Jason Gill
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
"name": "twitter-bootstrap-wizard",
"version": "1.0.0",
"ignore": [
"**/.*",
"examples",
"README.md",
"*.txt",
"*.html",
"prettify.js",
"prettify.css",
"bower.json"
],
"main": ["jquery.bootstrap.wizard.js"],
"dependencies": {
"jquery" : ">=1.9.1",
"bootstrap" : ">=2.3.0 <3.0"
}
}
......@@ -5,6 +5,7 @@
#sponsor {
text-align: center;
margin-bottom: 20px;
}
#calogo {
height: 70px;
......@@ -18,3 +19,7 @@
width: 20%;
}
input.cla-alert {
border: 1px solid red;
}
......@@ -10,7 +10,7 @@
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- <link href="bootstrap3/css/bootstrap.min.css" rel="stylesheet"> -->
<link href="prettify.css" rel="stylesheet">
<link href="css/prettify.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
......@@ -32,16 +32,16 @@
<div class="navbar-inner">
<div class="container">
<ul class="bullets">
<li><a href="#tab1"
<li><a href="#general"
data-toggle="tab">1. General</a></li>
<li><a href="#tab2"
<li><a href="#copyright"
data-toggle="tab">2. Copyright</a>
</li>
<li><a href="#tab3"
<li><a href="#patents"
data-toggle="tab">3. Patents</a></li>
<li><a href="#tab4"
<li><a href="#review"
data-toggle="tab">4. Review</a></li>
<li><a href="#tab5"
<li><a href="#apply"
data-toggle="tab">5. Apply</a></li>
</ul>
</div>
......@@ -52,7 +52,7 @@
</div>
<div class="tab-content">
<div class="tab-pane" id="tab1">
<div class="tab-pane" id="general">
<ul class="thumbnails">
<li class="span12">
......@@ -99,12 +99,12 @@
placeholder='A website address where instructions exist or people may sign your agreement.'
class="input-block-level">
<label for="field_jurisdiction">In what jurisdiction is this agreement to be valid?</label>
<input type="text" name="field_jurisdiction" id="field_jurisdiction" class="input-block-level" placeholder="Enter your jurisdiction(s).">
<label for="project-jurisdiction">In what jurisdiction is this agreement to be valid?</label>
<input type="text" name="project-jurisdiction" id="project-jurisdiction" class="input-block-level" placeholder="Enter your jurisdiction(s).">
</div>
<div class="tab-pane" id="tab2">
<div class="tab-pane" id="copyright">
<ul class="thumbnails">
<li class="span12">
......@@ -184,7 +184,7 @@
</select>
</div>
<div class="tab-pane" id="tab3">
<div class="tab-pane" id="patents">
<ul class="thumbnails">
<li class="span12">
......@@ -230,7 +230,7 @@
</div>
<div class="tab-pane" id="tab4">
<div class="tab-pane" id="review">
<ul class="thumbnails">
<li class="span12">
......@@ -285,7 +285,7 @@
</div>
<div class="tab-pane" id="tab5">
<div class="tab-pane" id="apply">
<ul class="thumbnails">
<li class="span12">
......@@ -363,34 +363,8 @@
<script src="js/showdown.js"></script>
<script src="jquery.bootstrap.wizard.js"></script>
<script src="prettify.js"></script>
<script>
$(document).ready(function() {
$('#rootwizard').bootstrapWizard({onNext: function(tab, navigation, index) {
/*
if(index==2) {
// Make sure we entered the name
if(!$('#name').val()) {
alert('You must enter your name');
$('#name').focus();
return false;
}
}
*/
// Set the name for the next tab
// $('#tab3').html('Hello, ' + $('#name').val());
}, onTabShow: function(tab, navigation, index) {
var $total = navigation.find('li').length;
var $current = index+1;
var $percent = ($current/$total) * 100;
$('#rootwizard').find('.bar').css({width:$percent+'%'});
}});
window.prettyPrint && prettyPrint()
});
</script>
<script src="js/jquery.bootstrap.wizard.js"></script>
<script src="js/prettify.js"></script>
<script src="js/footer.js"></script>
</body>
</html>
var generalPageIndex = 0;
var isGeneralPageOk = false;
var copyrightPageIndex = 1;
var isCopyrightPageOk = false;
var patentPageIndex = 2;
var isPatentPageOk = false;
var reviewPageIndex = 3;
var isReviewPageOk = false;
var applyPageIndex = 4;
var isApplyPageOk = false;
function validateEmail(email)
{
var re = /\S+@\S+\.\S+/;
return re.test(email);
}
function validateURL(textval) {
var urlregex = new RegExp(
"^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+))*$");
return urlregex.test(textval);
}
function oinspect (obj)
{
var str = "";
for(var k in obj)
if (obj.hasOwnProperty(k))
str += k + " = " + obj[k] + "\n";
alert(str);
}
function testGeneralPage ()
{
if ( !$('#project-family-name').val() ) {
$('#project-family-name').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#project-family-name').removeClass("cla-alert");
isGeneralPageOk = true;
}
if ( !$('#project-name').val() ) {
$('#project-name').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#project-name').removeClass("cla-alert");
isGeneralPageOk = true;
}
if ( !$('#project-website').val() ||
!validateURL( $('#project-website').val() ) ) {
$('#project-website').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#project-website').removeClass("cla-alert");
isGeneralPageOk = true;
}
if ( !$('#project-email').val() ||
!validateEmail($('#project-email').val()) )
{
$('#project-email').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#project-email').removeClass("cla-alert");
isGeneralPageOk = true;
}
if ( !$('#contributor-signing-process').val() ||
!validateURL( $('#contributor-signing-process').val() ) ) {
$('#contributor-signing-process').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#contributor-signing-process').removeClass("cla-alert");
isGeneralPageOk = true;
}
if ( !$('#project-jurisdiction').val() ) {
$('#project-jurisdiction').addClass("cla-alert");
isGeneralPageOk = false;
} else {
$('#project-jurisdiction').removeClass("cla-alert");
isGeneralPageOk = true;
}
return isGeneralPageOk;
}
$(document).ready(function() {
//$("#wizard").steps();
......@@ -14,9 +114,68 @@ $(document).ready(function() {
});
$('#rootwizard').bootstrapWizard({onNext: function(tab, navigation, index)
{
console.log("tab: " + tab);
console.log("navigation: " + navigation);
console.log("index: " + index);
switch( index )
{
case generalPageIndex + 1:
return testGeneralPage();
break;
case 2:
return testCopyrightPage();
break;
}
}, onTabShow: function(tab, navigation, index) {
var $total = navigation.find('li').length;
var $current = index+1;
var $percent = ($current/$total) * 100;
$('#rootwizard').find('.bar').css({width:$percent+'%'});
},
onTabClick: function(tab, navigation, index) {
console.log("tab: " + tab);
// oinspect(tab);
console.log("navigation: " + navigation);
// oinspect(navigation);
console.log("index: " + index);
// alert('on tab click disabled');
//
/*
if ( index == ( generalPageIndex + 1 ) && isGeneralPageOk )
return true;
if ( index == ( copyrightPageIndex + 1 ) && isCopyrightPageOk )
return true;
if ( index == ( patentPageIndex + 1 ) && isPatentPageOk )
return true;
if ( index == ( reviewPageIndex + 1 ) && isReviewPageOk )
return true;
if ( index == ( applyPageIndex + 1 ) && isApplyPageOk )
return true;
*/
return false;
} }
);
window.prettyPrint && prettyPrint()
// console.log("myTest: " + myTest);
// $( "#review" ).html( converter.makeHtml( $( "#review" ).html() ) );
//var textz = $( "#review" ).html();
// console.log("text: " + textz);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment