Initial commit
This commit is contained in:
57
site/javascript/admin/textboxbuttons.js
Normal file
57
site/javascript/admin/textboxbuttons.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/***********************************************
|
||||
* Admin textbox button styles for: friendshiptours.org
|
||||
* Author: Benjamin Ramey
|
||||
* E-mail: ben.ramey@gmail.com
|
||||
* Created: Tue Feb 12 16:40:04 CST 2008
|
||||
***********************************************/
|
||||
$(function() {
|
||||
//
|
||||
// Bold button
|
||||
//
|
||||
$("#bold_btn").click(function() {
|
||||
var textBox = document.getElementById('text');
|
||||
// get the selected text
|
||||
var selectedText = (textBox.value).substring(textBox.selectionStart,textBox.selectionEnd);
|
||||
|
||||
if(selectedText.length > 0)
|
||||
{
|
||||
var boldText = "[b]"+selectedText+"[/b]";
|
||||
textBox.value = (textBox.value).replace(selectedText,boldText);
|
||||
}
|
||||
});
|
||||
//
|
||||
// Italics button
|
||||
//
|
||||
$("#italics_btn").click(function() {
|
||||
var textBox = document.getElementById('text');
|
||||
// get the selected text
|
||||
var selectedText = (textBox.value).substring(textBox.selectionStart,textBox.selectionEnd);
|
||||
|
||||
if(selectedText.length > 0)
|
||||
{
|
||||
var italicsText = "[i]"+selectedText+"[/i]";
|
||||
textBox.value = (textBox.value).replace(selectedText,italicsText);
|
||||
}
|
||||
});
|
||||
//
|
||||
// Link button
|
||||
//
|
||||
$("#link_btn").click(function() {
|
||||
var textBox = document.getElementById('text');
|
||||
// get the selected text
|
||||
var selectedText = (textBox.value).substring(textBox.selectionStart,textBox.selectionEnd);
|
||||
|
||||
if(selectedText.length > 0)
|
||||
{
|
||||
var linkHref = new String();
|
||||
while((linkHref = prompt("Please enter the URL for this link:")).length <= 0)
|
||||
;
|
||||
|
||||
if(linkHref.length > 0)
|
||||
{
|
||||
var italicsText = "[link href="+linkHref+"]"+selectedText+"[/link]";
|
||||
textBox.value = (textBox.value).replace(selectedText,italicsText);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
41
site/javascript/bookingrequest.js
Normal file
41
site/javascript/bookingrequest.js
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Javascript for booking request page
|
||||
//
|
||||
// Ben Ramey
|
||||
// November 2009
|
||||
//
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
$.datepicker.setDefaults({
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
minDate: "-100y",
|
||||
maxDate: "+1y",
|
||||
yearRange: "-100:+1"
|
||||
});
|
||||
|
||||
function AddPassenger(e)
|
||||
{
|
||||
var table = $("table.passengers");
|
||||
var newRow = $("table.passengers>tbody>tr:last-child").clone();
|
||||
var passengerLabelCell = newRow.find("th");
|
||||
var numExistingPassengers = table.find("tbody>tr").length;
|
||||
|
||||
passengerLabelCell.text("Passenger " + Number(numExistingPassengers + 1));
|
||||
newRow.find("input").removeAttr("id").val("");
|
||||
newRow.find("select").val("Male");
|
||||
newRow.find("input.date-input").removeClass("hasDatepicker").datepicker();
|
||||
newRow.attr("passengernumber", numExistingPassengers + 1);
|
||||
|
||||
table.append(newRow);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// make all the date-input inputs datepickers
|
||||
$("input.date-input").datepicker();
|
||||
|
||||
$("button#AddPassengerBtn").click(AddPassenger);
|
||||
}
|
||||
);
|
||||
77
site/javascript/default.js
Normal file
77
site/javascript/default.js
Normal file
@@ -0,0 +1,77 @@
|
||||
/***********************************************
|
||||
* Default javascript for: friendshiptours.org
|
||||
* Author: Benjamin Ramey
|
||||
* E-mail: ben.ramey@gmail.com
|
||||
* Created: Tue Dec 18 17:46:35 CST 2007
|
||||
***********************************************/
|
||||
$(function() {
|
||||
//
|
||||
// home page
|
||||
//
|
||||
if($("body").attr("id") == 'index')
|
||||
{
|
||||
$("#news-jumper-select").change(function() {
|
||||
if($(this).val() != '')
|
||||
{
|
||||
document.location = '#'+$(this).val();
|
||||
}
|
||||
});
|
||||
}
|
||||
//
|
||||
// passport info page
|
||||
//
|
||||
else if($("#passportinfo_form"))
|
||||
{
|
||||
$("#add_person").click(function() {
|
||||
var personHtml = "<fieldset class='person'>"+$("fieldset.person:first").html()+"</fieldset>";
|
||||
// insert a new fieldset with passport form after the first one
|
||||
$("fieldset.person:last").after(personHtml);
|
||||
// this element selected next is the fieldset we just added
|
||||
$("fieldset.person:last input.delete_person").attr("disabled",'').click(
|
||||
function() {
|
||||
DeletePassportPerson($(this));
|
||||
return false;
|
||||
});
|
||||
|
||||
// since we just added a person, we have at least two people, so we want
|
||||
// the first person's 'delete person' button enabled
|
||||
$("input.delete_person:first").attr('disabled','');
|
||||
|
||||
return false;
|
||||
});
|
||||
// apply delete person function to click on first delete person button
|
||||
$("input.delete_person").click(function() {
|
||||
DeletePassportPerson($(this));
|
||||
return false;
|
||||
});
|
||||
}
|
||||
//
|
||||
// credit card page
|
||||
//
|
||||
else if($("body").attr('id') == 'creditcard')
|
||||
{
|
||||
$("#cvv_help").click(function() {
|
||||
var message = "The security code is on the back of your card above and to the right of your signature - the last three digits located there.\n\n"
|
||||
+ "For example, a card with the number 1111 2222 3333 4444 will have 4444 123 written on the back.\n\n"
|
||||
+ "In this example, the number 123 is the security code.\n\n"
|
||||
+ "The exception to this is an American Express card. The security code in this case is a a four digit number on the FRONT of the card, above and to the right of the embossed number.";
|
||||
|
||||
alert(message);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function DeletePassportPerson(buttonElement)
|
||||
{
|
||||
var numButtons = 0;
|
||||
// remove this person
|
||||
buttonElement.parents("fieldset").remove();
|
||||
|
||||
// count the number of buttons we have (which should be the number of
|
||||
// people we have too)
|
||||
$("input.delete_person").each(function() { numButtons++; });
|
||||
// disable the first delete person (so they can't delete ALL people and
|
||||
// submit none)
|
||||
if(numButtons < 2)
|
||||
$("input.delete_person:first").attr('disabled','disabled');
|
||||
}
|
||||
22
site/javascript/jquery-ui.min.js
vendored
Executable file
22
site/javascript/jquery-ui.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
19
site/javascript/jquery.min.js
vendored
Executable file
19
site/javascript/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user