-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validation issue has been fixed for IE
- Loading branch information
Showing
12 changed files
with
82 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
$(document).ready -> | ||
errorElements = $('.content').find('.help-inline').prev() | ||
ul = $('<ul id="errorlist"></ul>') | ||
errorElements.each (i) -> | ||
span = $(this).next() | ||
labelText = $(this).parent().parent().find('label') | ||
$(' <li> <a href="#' + $(this).attr('id') + '" onclick=" " >' + labelText.text() + ' ' + '(' + span.text() + ')' + '</a></li>').appendTo(ul) | ||
$('#errorcontainer').html(ul) | ||
$("#bonus_round_unlocked").click -> | ||
$("#bonus_round").show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
$(document).ready -> | ||
# alert("hello") | ||
#error elements test | ||
#alert("error elements:" + $('.content:first .help-inline').size()) | ||
#get the errorElements | ||
errorElements = $(document).find('.help-inline') | ||
|
||
#validate only if errors exist | ||
if(errorElements.length > 0) | ||
#test where error container is | ||
#$("#errorcontainer").html("Here I am") | ||
|
||
#ul element as container for error summary | ||
errorSummaryContainer = $(document.createElement("ul")) | ||
errorSummaryContainer.attr("id","errorlist") | ||
|
||
#append error summary to error container | ||
$("#errorcontainer").append(errorSummaryContainer) | ||
|
||
#Iterate through the error elements to create summary | ||
#test individual error elements | ||
#i = 0 | ||
errorElements.each -> | ||
#Test results for each individual error element | ||
#alert("this is error number " + ++i) | ||
|
||
#individual participents | ||
errorElement = $(this)#Note this singular | ||
inputElement = errorElement.prev()#preventing another call to $(this) | ||
labelElement = errorElement.parent().prev()#again preventing another call to $(this) | ||
|
||
#test whether we have all the above three elements | ||
#alert(labelElement.text() + ":" + labelElement.attr("for") + ":" + inputElement.attr("id") + ":" + errorElement.text()) | ||
#test to get only label text without the "*" sign | ||
#alert(labelElement.contents().last().text()) | ||
|
||
#Error string | ||
labelText = labelElement.contents().last().text()#without the "*" | ||
errorString = labelText + "(" + errorElement.text() + ")"#e.g. First Name(Can't be blank) | ||
|
||
#anchor element for error string | ||
anchorElement = $(document.createElement("a")) | ||
#Siddhant thinks that focussing input element can work even without the href in action | ||
anchorElement.attr("href","javascript:void(0)") | ||
anchorElement.addClass("errorlink") | ||
anchorElement.text(errorString) | ||
|
||
anchorElement.click -> | ||
alert("hello") | ||
$("#" + inputElement.attr("id")).focus() | ||
|
||
#listElement for anchor element | ||
listElement = $(document.createElement("li")) | ||
errorSummaryContainer.append(listElement) | ||
listElement.append(anchorElement) | ||
|
||
|
||
#End iteration | ||
$(".errorlink:first").focus() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
%h1.delta New topic for #{@level.level_name} level | ||
.content | ||
= render 'form' | ||
- content_for :javascript do | ||
= javascript_include_tag 'nested_form' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+5.47 MB
...contents/topic_contents/5239/4048/efe4/6e7f/1f00/005a/original/10_TU_MERI_ZINDAGI_HAI.MP3
Binary file not shown.