Maven migration (first draft)
|
@ -1,242 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var associateProfileFields = {
|
||||
onLoad: function() {
|
||||
if (this.disableFormInUnsupportedBrowsers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.mixIn();
|
||||
this.initObjectReferences();
|
||||
this.bindEventListeners();
|
||||
this.setInitialState();
|
||||
},
|
||||
|
||||
disableFormInUnsupportedBrowsers: function() {
|
||||
var disableWrapper = $('#ie67DisableWrapper');
|
||||
|
||||
// Check for unsupported browsers only if the element exists on the page
|
||||
if (disableWrapper.length) {
|
||||
if (vitro.browserUtils.isIELessThan8()) {
|
||||
disableWrapper.show();
|
||||
$('.noIE67').hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
mixIn: function() {
|
||||
$.extend(this, associateProfileFieldsData);
|
||||
},
|
||||
|
||||
initObjectReferences: function() {
|
||||
this.form = $('#userAccountForm');
|
||||
|
||||
// The external auth ID field and messages
|
||||
this.externalAuthIdField = $('#externalAuthId');
|
||||
this.externalAuthIdInUseMessage = $('#externalAuthIdInUse');
|
||||
|
||||
// We have an associated profile
|
||||
this.associatedArea = $('#associated');
|
||||
this.associatedProfileNameSpan = $('#associatedProfileName');
|
||||
this.verifyAssociatedProfileLink = $('#verifyProfileLink');
|
||||
this.changeAssociatedProfileLink = $('#changeProfileLink');
|
||||
this.associatedProfileUriField = $('#associatedProfileUri')
|
||||
|
||||
// We want to associate a profile
|
||||
this.associationOptionsArea = $('#associationOptions');
|
||||
this.associateProfileNameField = $('#associateProfileName');
|
||||
this.newProfileClassSelector = $('#newProfileClassUri');
|
||||
|
||||
// Container <div> elements to provide background shading -- tlw72
|
||||
this.associateProfileBackgroundOneArea = $('#associateProfileBackgroundOne');
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
this.idCache = {};
|
||||
this.externalAuthIdField.change(function() {
|
||||
associateProfileFields.externalAuthIdFieldHasChanged();
|
||||
});
|
||||
this.externalAuthIdField.keyup(function() {
|
||||
associateProfileFields.externalAuthIdFieldHasChanged();
|
||||
});
|
||||
this.externalAuthIdField.bind("propertychange", function() {
|
||||
associateProfileFields.externalAuthIdFieldHasChanged();
|
||||
});
|
||||
this.externalAuthIdField.bind("input", function() {
|
||||
associateProfileFields.externalAuthIdFieldHasChanged();
|
||||
});
|
||||
|
||||
this.verifyAssociatedProfileLink.click(function() {
|
||||
associateProfileFields.openVerifyWindow();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.changeAssociatedProfileLink.click(function() {
|
||||
associateProfileFields.showAssociatingOptionsArea();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.newProfileClassSelector.change(function() {
|
||||
associateProfileFields.newProfileClassHasChanged();
|
||||
});
|
||||
|
||||
this.acCache = {};
|
||||
this.associateProfileNameField.autocomplete({
|
||||
minLength: 3,
|
||||
source: function(request, response) {
|
||||
if (request.term in associateProfileFields.acCache) {
|
||||
response(associateProfileFields.acCache[request.term]);
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: associateProfileFields.ajaxUrl,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: "autoCompleteProfile",
|
||||
term: request.term,
|
||||
externalAuthId: associateProfileFields.externalAuthIdField.val()
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
var results = jQuery.parseJSON(xhr.responseText);
|
||||
associateProfileFields.acCache[request.term] = results;
|
||||
response(results);
|
||||
}
|
||||
});
|
||||
},
|
||||
select: function(event, ui) {
|
||||
associateProfileFields.showAssociatedProfileArea(ui.item.label, ui.item.uri, ui.item.url);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
setInitialState: function() {
|
||||
if (this.externalAuthIdField.val().length == 0) {
|
||||
this.hideAllOptionals();
|
||||
} else if (this.associatedProfileInfo) {
|
||||
this.showAssociatedProfileArea(this.associatedProfileInfo.label, this.associatedProfileInfo.uri, this.associatedProfileInfo.url);
|
||||
} else {
|
||||
this.showAssociatingOptionsArea();
|
||||
}
|
||||
},
|
||||
|
||||
externalAuthIdFieldHasChanged: function() {
|
||||
var externalAuthId = this.externalAuthIdField.val();
|
||||
|
||||
if (externalAuthId.length == 0) {
|
||||
this.hideAllOptionals();
|
||||
return;
|
||||
}
|
||||
|
||||
if (externalAuthId in this.idCache) {
|
||||
var results = this.idCache[externalAuthId];
|
||||
this.applyAjaxResultsForExternalAuthIdField(results)
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: associateProfileFields.ajaxUrl,
|
||||
dataType: "json",
|
||||
data: {
|
||||
action: "checkExternalAuth",
|
||||
userAccountUri: associateProfileFields.userUri,
|
||||
externalAuthId: externalAuthId
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
var results = $.parseJSON(xhr.responseText);
|
||||
associateProfileFields.idCache[externalAuthId] = results;
|
||||
associateProfileFields.applyAjaxResultsForExternalAuthIdField(results);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
applyAjaxResultsForExternalAuthIdField: function(results) {
|
||||
if (results.idInUse) {
|
||||
this.showExternalAuthInUseMessage()
|
||||
} else if (results.matchesProfile) {
|
||||
this.showAssociatedProfileArea(results.profileLabel, results.profileUri, results.profileUrl)
|
||||
} else {
|
||||
this.showAssociatingOptionsArea();
|
||||
}
|
||||
},
|
||||
|
||||
openVerifyWindow: function() {
|
||||
window.open(this.verifyUrl, 'verifyMatchWindow', 'width=640,height=640,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no');
|
||||
},
|
||||
|
||||
newProfileClassHasChanged: function() {
|
||||
if (this.newProfileClassSelector.val().length == 0) {
|
||||
this.associateProfileNameField.attr("disabled","");
|
||||
} else {
|
||||
this.associateProfileNameField.val('');
|
||||
this.associateProfileNameField.attr("disabled","disabled");
|
||||
}
|
||||
},
|
||||
|
||||
hideAllOptionals: function() {
|
||||
this.hideExternalAuthInUseMessage();
|
||||
this.hideAssociatedProfileArea();
|
||||
this.hideAssociatingOptionsArea();
|
||||
},
|
||||
|
||||
hideExternalAuthInUseMessage: function() {
|
||||
this.externalAuthIdInUseMessage.hide();
|
||||
},
|
||||
|
||||
hideAssociatedProfileArea: function() {
|
||||
this.associatedArea.hide();
|
||||
this.associateProfileBackgroundOneArea.css("background-color","#fff");
|
||||
this.associateProfileBackgroundOneArea.css("border","none");
|
||||
this.associatedProfileUriField.val('');
|
||||
},
|
||||
|
||||
hideAssociatingOptionsArea: function() {
|
||||
this.associationOptionsArea.hide();
|
||||
this.associateProfileBackgroundOneArea.css("background-color","#fff");
|
||||
this.associateProfileBackgroundOneArea.css("border","none");
|
||||
this.associateProfileNameField.val('');
|
||||
this.newProfileClassSelector.get(0).selectedIndex = 0;
|
||||
},
|
||||
|
||||
showExternalAuthInUseMessage: function() {
|
||||
this.hideAssociatedProfileArea();
|
||||
this.hideAssociatingOptionsArea();
|
||||
|
||||
this.externalAuthIdInUseMessage.show();
|
||||
},
|
||||
|
||||
showAssociatedProfileArea: function(name, uri, url) {
|
||||
this.hideExternalAuthInUseMessage();
|
||||
this.hideAssociatingOptionsArea();
|
||||
|
||||
if (this.associationEnabled) {
|
||||
this.associatedProfileNameSpan.html(name);
|
||||
this.associatedProfileUriField.val(uri);
|
||||
this.verifyUrl = url;
|
||||
this.associatedArea.show();
|
||||
this.associateProfileBackgroundOneArea.css("background-color","#f1f2ee");
|
||||
this.associateProfileBackgroundOneArea.css("border","1px solid #ccc");
|
||||
}
|
||||
},
|
||||
|
||||
showAssociatingOptionsArea: function() {
|
||||
this.hideExternalAuthInUseMessage();
|
||||
this.hideAssociatedProfileArea();
|
||||
|
||||
if (this.associationEnabled) {
|
||||
this.newProfileClassHasChanged();
|
||||
this.associationOptionsArea.show();
|
||||
this.associateProfileBackgroundOneArea.css("background-color","#f1f2ee");
|
||||
this.associateProfileBackgroundOneArea.css("border","1px solid #ccc");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
associateProfileFields.onLoad();
|
||||
});
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
// Change form actions in account main page
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// The externalAuthOnly checkbox drives the display of the password and re-set
|
||||
// password fields. When checked, the password fields are hidden
|
||||
$('input:checkbox[name=externalAuthOnly]').click(function(){
|
||||
if ( this.checked ) {
|
||||
// If checked, hide those puppies
|
||||
$('#passwordContainer').addClass('hidden');
|
||||
$('#pwdResetContainer').addClass('hidden');
|
||||
// And clear any values entered in the password fields
|
||||
$('input[name=confirmPassword]').val("");
|
||||
$('input[name=initialPassword]').val("");
|
||||
$('input[name=newPassword]').val("");
|
||||
}
|
||||
else {
|
||||
// if not checked, display them
|
||||
$('#passwordContainer').removeClass('hidden');
|
||||
$('#pwdResetContainer').removeClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
|
@ -1,43 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
// Sets up event listeners so that the submit button gets enabled only if the user has changed
|
||||
// an existing value.
|
||||
//
|
||||
// Used with both the userAccounts--myAccounts.ftl and userAccounts--edit.ftl.
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var theForm = $('form').last();
|
||||
var theSubmitButton = theForm.find(':submit');
|
||||
|
||||
theSubmitButton.addClass("disabledSubmit");
|
||||
|
||||
function disableSubmit() {
|
||||
theSubmitButton.removeAttr('disabled');
|
||||
theSubmitButton.removeClass("disabledSubmit");
|
||||
}
|
||||
|
||||
$('input').each(function() {
|
||||
if ( $(this).attr('type') != 'submit' && $(this).attr('name') != 'querytext') {
|
||||
$(this).change(function() {
|
||||
disableSubmit()
|
||||
});
|
||||
$(this).bind("propertychange", function() {
|
||||
disableSubmit();
|
||||
});
|
||||
$(this).bind("input", function() {
|
||||
disableSubmit()
|
||||
});
|
||||
}
|
||||
});
|
||||
$('select').each(function() {
|
||||
$(this).change(function() {
|
||||
disableSubmit()
|
||||
});
|
||||
});
|
||||
|
||||
$('.remove-proxy').click(function(){
|
||||
disableSubmit()
|
||||
})
|
||||
});
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/*
|
||||
* A collection of building blocks for the proxy-management UI.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
* itemElement
|
||||
* ----------------------------------------------------------------------------
|
||||
* Display information about an entity according to the template. The entity
|
||||
* can be either:
|
||||
* a profile -- Individual to be edited.
|
||||
* a proxy -- User Account to do the editing, optionally with info from a
|
||||
* profile associated with that individual.
|
||||
*
|
||||
* You provide:
|
||||
* template -- the HTML text that determines how the element should look.
|
||||
* The template must be a single HTML element, which may contain
|
||||
* any number of sub-elements. It needs to have a single outer
|
||||
* wrapper, however.
|
||||
* uri, label, classLabel, imageUrl -- as described below
|
||||
* remove -- a function that we can call when the user clicks on the remove
|
||||
* link or button. We will pass a reference to this struct.
|
||||
* ----------------------------------------------------------------------------
|
||||
* The template must inlude a link or button with attribute templatePart="remove"
|
||||
*
|
||||
* The template may include tokens to be replaced, from the following:
|
||||
* %uri% -- the URI of the individual being displayed
|
||||
* %label& -- the label of the individual.
|
||||
* %classLabel% -- the label of the most specific class of the individual.
|
||||
* %imageUrl% -- the URL that will fetch the image of the individual,
|
||||
* or a placeholder image.
|
||||
* ----------------------------------------------------------------------------
|
||||
* This relies on magic names for the styles:
|
||||
* existingProxyItem -- for an item that was present when the page was loaded
|
||||
* newProxyItem -- for an item that was added since the page was loaded
|
||||
* removedProxyItem -- added to an item when the "remove" link is cheked.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
function itemElement(template, uri, label, classLabel, imageUrl, removeInfo) {
|
||||
var self = this;
|
||||
|
||||
this.uri = uri;
|
||||
this.label = label;
|
||||
this.classLabel = classLabel;
|
||||
this.imageUrl = imageUrl;
|
||||
this.removeInfo = removeInfo;
|
||||
|
||||
this.toString = function() {
|
||||
return "itemElement: " + content;
|
||||
}
|
||||
|
||||
this.element = function() {
|
||||
var content = template.replace(/%uri%/g, this.uri)
|
||||
.replace(/%label%/g, this.label)
|
||||
.replace(/%classLabel%/g, this.classLabel)
|
||||
.replace(/%imageUrl%/g, this.imageUrl);
|
||||
|
||||
var element = $(content);
|
||||
element.addClass("proxyInfoElement");
|
||||
|
||||
var removeLink = $("[templatePart='remove']", element).first();
|
||||
removeLink.click(function(event) {
|
||||
self.removeInfo(self);
|
||||
return false;
|
||||
});
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
* proxyAutoComplete
|
||||
* ----------------------------------------------------------------------------
|
||||
* Attach the autocomplete funcionality that we like in proxy panels.
|
||||
*
|
||||
* You provide:
|
||||
* parms -- a map containing the URL and the action code needed for the AJAX call.
|
||||
* excludedUris -- these URIs are always filtered out of the results.
|
||||
* getProxyInfos -- a function that will return an array of itemElements
|
||||
* that are already present in the list and so should be filtered out of
|
||||
* the autocomplete response.
|
||||
* addProxyInfo -- a function that we can call when an item is selected.
|
||||
* It will take the selection info, build an itemElement, and add
|
||||
* it to the panel.
|
||||
* reportSearchStatus -- a function that we can call when a search is done. It
|
||||
* will accept the length of the search term and the number of results,
|
||||
* and will display it in some way.
|
||||
* ----------------------------------------------------------------------------
|
||||
* The AJAX request will include a "term" parameter, set to the current search term.
|
||||
* ----------------------------------------------------------------------------
|
||||
* The functionality includes:
|
||||
* -- fetching data for the autocomplete list.
|
||||
* -- cacheing the fetched data
|
||||
* -- filtering as described above.
|
||||
* -- calling addProxyInfo() and clearing the field when a value is selected.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
function proxyAutocomplete(parms, excludedUris, getProxyInfos, addProxyInfo, reportSearchStatus) {
|
||||
var cache = [];
|
||||
|
||||
var filterResults = function(parsed) {
|
||||
var filtered = [];
|
||||
var existingUris = $.map(getProxyInfos(), function(p) {
|
||||
return p.uri;
|
||||
});
|
||||
$.each(parsed, function(i, p) {
|
||||
if ((-1 == $.inArray(p.uri, existingUris))
|
||||
&& (-1 == $.inArray(p.uri, excludedUris))) {
|
||||
filtered.push(p);
|
||||
}
|
||||
});
|
||||
return filtered;
|
||||
}
|
||||
|
||||
var sendResponse = function(request, response, results) {
|
||||
reportSearchStatus(request.term.length, results.length);
|
||||
response(results);
|
||||
}
|
||||
|
||||
this.minLength = 0,
|
||||
|
||||
this.source = function(request, response) {
|
||||
if (request.term.length < 3) {
|
||||
sendResponse(request, response, []);
|
||||
return;
|
||||
}
|
||||
if (request.term in cache) {
|
||||
sendResponse(request, response, filterResults(cache[request.term]));
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: parms.url,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: parms.action,
|
||||
term: request.term
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
var results = $.parseJSON(xhr.responseText);
|
||||
cache[request.term] = results;
|
||||
sendResponse(request, response, filterResults(results));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.select = function(event, ui) {
|
||||
addProxyInfo(ui.item);
|
||||
event.preventDefault();
|
||||
event.target.value = '';
|
||||
}
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
* proxyItemsPanel
|
||||
* ----------------------------------------------------------------------------
|
||||
* Display an AJAX-enabled list of proxy-related items (either proxies or
|
||||
* profiles).
|
||||
*
|
||||
* The list may start out with a population of items. items may be added by
|
||||
* selecting them in the auto-complete box. Items may be removed by clicking
|
||||
* the "remove" link next to that item.
|
||||
*
|
||||
* A hidden field will hold the URI for each item, so when the form is submitted,
|
||||
* the controller can determine the list of items.
|
||||
* ----------------------------------------------------------------------------
|
||||
* You provide:
|
||||
* p -- the DOM element that contains the template and the data.
|
||||
* It also contains the autocomplete field, with a status element and
|
||||
* perhaps 1 or more excluded URIs
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
function proxyItemsPanel(panel, contextInfo) {
|
||||
var self = this;
|
||||
|
||||
this.itemData = [];
|
||||
|
||||
var dataContainerElement = $("[name='proxyData']", panel).first();
|
||||
var autoCompleteField = $("input[name='proxySelectorAC']", panel).first();
|
||||
var searchStatusField = $("span[name='proxySelectorSearchStatus']", panel).first();
|
||||
var excludedUris = [];
|
||||
$("[name='excludeUri']", panel).each(function(index) {
|
||||
excludedUris.push($(this).text());
|
||||
});
|
||||
|
||||
var parseTemplate = function(dataContainer) {
|
||||
var templateDiv = $("div[name='template']", dataContainer)
|
||||
var templateHtml = templateDiv.html();
|
||||
templateDiv.remove();
|
||||
return templateHtml;
|
||||
};
|
||||
this.templateHtml = parseTemplate(dataContainerElement);
|
||||
|
||||
this.displayItemData = function() {
|
||||
$(".proxyInfoElement", dataContainerElement).remove();
|
||||
|
||||
for (i = 0; i < self.itemData.length; i++) {
|
||||
self.itemData[i].element().appendTo(dataContainerElement);
|
||||
}
|
||||
}
|
||||
|
||||
var getItemData = function() {
|
||||
return self.itemData;
|
||||
}
|
||||
|
||||
this.removeItem = function(info) {
|
||||
var i;
|
||||
for (i = 0; i < self.itemData.length; i++) {
|
||||
if (self.itemData[i] === info) {
|
||||
self.itemData.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.displayItemData();
|
||||
}
|
||||
|
||||
this.addItemData = function(selection) {
|
||||
var info = new itemElement(self.templateHtml, selection.uri, selection.label,
|
||||
selection.classLabel, selection.imageUrl, self.removeItem);
|
||||
self.itemData.unshift(info);
|
||||
self.displayItemData();
|
||||
self.getAdditionalData(self, info, selection.externalAuthId)
|
||||
}
|
||||
|
||||
this.getAdditionalData = function(parent, info, externalAuthId) {
|
||||
data = info
|
||||
$.ajax({
|
||||
url: contextInfo.ajaxUrl,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: contextInfo.moreInfoAction,
|
||||
uri: info.uri
|
||||
},
|
||||
complete: function(xhr, status) {
|
||||
var results = $.parseJSON(xhr.responseText);
|
||||
if (results.length > 0) {
|
||||
if ("classLabel" in results[0]) {
|
||||
info.classLabel = results[0].classLabel;
|
||||
}
|
||||
if ("imageUrl" in results[0]) {
|
||||
info.imageUrl = results[0].imageUrl;
|
||||
}
|
||||
self.displayItemData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var parseOriginalData = function() {
|
||||
var dataDivs = $("div[name='data']", dataContainerElement)
|
||||
var data = [];
|
||||
for (i = 0; i < dataDivs.length; i++) {
|
||||
var dd = dataDivs[i];
|
||||
var uri = $("p[name='uri']", dd).text();
|
||||
var label = $("p[name='label']", dd).text();
|
||||
var classLabel = $("p[name='classLabel']", dd).text();
|
||||
var imageUrl = $("p[name='imageUrl']", dd).text();
|
||||
data.push(new itemElement(self.templateHtml, uri, label, classLabel, imageUrl, self.removeItem));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
this.itemData = parseOriginalData();
|
||||
|
||||
var setupAutoCompleteFields = function() {
|
||||
var parms = {
|
||||
url: contextInfo.ajaxUrl,
|
||||
action: contextInfo.basicInfoAction
|
||||
}
|
||||
var updateStatus = new statusFieldUpdater(searchStatusField, 3).setText;
|
||||
var autocompleteInfo = new proxyAutocomplete(parms, excludedUris, getItemData, self.addItemData, updateStatus)
|
||||
autoCompleteField.autocomplete(autocompleteInfo);
|
||||
}
|
||||
setupAutoCompleteFields();
|
||||
|
||||
self.displayItemData();
|
||||
}
|
||||
|
||||
function statusFieldUpdater(element, minLength) {
|
||||
var emptyText = element.text();
|
||||
var moreCharsText = element.attr('moreCharsText');
|
||||
var noMatchText = element.attr('noMatchText');
|
||||
|
||||
this.setText = function(searchTermLength, numberOfResults) {
|
||||
if (numberOfResults > 0) {
|
||||
element.text('');
|
||||
} else if (searchTermLength == 0) {
|
||||
element.text(emptyText);
|
||||
} else if (searchTermLength < minLength) {
|
||||
element.text(moreCharsText);
|
||||
} else {
|
||||
element.text(noMatchText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute this when the page loads.
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
var disableFormInUnsupportedBrowsers = function() {
|
||||
var disableWrapper = $('#ie67DisableWrapper');
|
||||
|
||||
// Check for unsupported browsers only if the element exists on the page
|
||||
if (disableWrapper.length) {
|
||||
if (vitro.browserUtils.isIELessThan8()) {
|
||||
disableWrapper.show();
|
||||
$('.noIE67').hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/* If we don't support this form in this browser, just stop here. */
|
||||
if (disableFormInUnsupportedBrowsers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("section[name='proxyProfilesPanel']").each(function(i) {
|
||||
var context = {
|
||||
baseUrl: proxyContextInfo.baseUrl,
|
||||
ajaxUrl: proxyContextInfo.ajaxUrl,
|
||||
basicInfoAction: "getAvailableProfiles",
|
||||
moreInfoAction: "moreProfileInfo"
|
||||
}
|
||||
this["proxyItemsPanel"] = new proxyItemsPanel(this, context);
|
||||
});
|
||||
|
||||
$("section[name='proxyProxiesPanel']").each(function(i) {
|
||||
var context = {
|
||||
baseUrl: proxyContextInfo.baseUrl,
|
||||
ajaxUrl: proxyContextInfo.ajaxUrl,
|
||||
basicInfoAction: "getAvailableProxies",
|
||||
moreInfoAction: "moreProxyInfo"
|
||||
}
|
||||
this["proxyItemsPanel"] = new proxyItemsPanel(this, context);
|
||||
});
|
||||
|
||||
//Add progress indicator for autocomplete input fields
|
||||
|
||||
var progressImage;
|
||||
|
||||
$('#addProfileEditor').click(function(event){
|
||||
progressImage = $(event.target).closest("section").find(".loading-profileMyAccoount")
|
||||
});
|
||||
|
||||
$('#selectProfileEditors').click(function(event){
|
||||
progressImage = $(event.target).closest("section").find(".loading-relateEditor")
|
||||
});
|
||||
|
||||
$('#selectProfiles').click(function(event){
|
||||
progressImage = $(event.target).closest("section").find(".loading-relateProfile")
|
||||
});
|
||||
|
||||
$('#addProfile').click(function(event){
|
||||
progressImage = $(event.target).closest("section").find(".loading-addProfile")
|
||||
});
|
||||
|
||||
|
||||
$(document).ajaxStart(function(){
|
||||
progressImage.removeClass('hidden').css('display', 'inline-block');
|
||||
});
|
||||
|
||||
$(document).ajaxStop(function(){
|
||||
progressImage.hide().addClass('hidden');
|
||||
});
|
||||
});
|
|
@ -1,75 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
// Change form actions in account main page
|
||||
function changeAction(form, url) {
|
||||
form.action = url;
|
||||
return true;
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// If filtering by role, make sure the role is included as a parameter (1) when the
|
||||
// page count changes or (2) when the next or previous links are clicked.
|
||||
if ( $('#roleFilterUri').val().length > 0 ) {
|
||||
var roleURI = $('#roleFilterUri').val().substring($('#roleFilterUri').val().indexOf("=")+1);
|
||||
roleURI = roleURI.replace("%3A%2F%2F","://").replace("%23","#").replace(/%2F/g,"/")
|
||||
$('input#roleTypeContainer').val(roleURI);
|
||||
var prevHref = $('a#previousPage').attr('href');
|
||||
var nextHref = $('a#nextPage').attr('href');
|
||||
prevHref += "&roleFilterUri=" + roleURI.replace("#","%23");
|
||||
nextHref += "&roleFilterUri=" + roleURI.replace("#","%23");
|
||||
$('a#previousPage').attr('href',prevHref);
|
||||
$('a#nextPage').attr('href',nextHref);
|
||||
}
|
||||
|
||||
//Accounts per page
|
||||
//Hide if javascript is enabled
|
||||
$('input[name="accounts-per-page"]').addClass('hidden');
|
||||
|
||||
$('.accounts-per-page').change(function() {
|
||||
// ensure both accounts-per-page select elements are
|
||||
// set to the same value before submitting
|
||||
var selectedValue = $(this).val();
|
||||
$('.accounts-per-page').val(selectedValue);
|
||||
$('#account-display').submit();
|
||||
});
|
||||
|
||||
//Delete accounts
|
||||
//Show is javascript is enabled
|
||||
$('input:checkbox[name=delete-all]').removeClass('hidden');
|
||||
|
||||
$('input:checkbox[name=delete-all]').click(function(){
|
||||
if ( this.checked ) {
|
||||
// if checked, select all the checkboxes
|
||||
$('input:checkbox[name=deleteAccount]').attr('checked','checked');
|
||||
|
||||
} else {
|
||||
// if not checked, deselect all the checkboxes
|
||||
$('input:checkbox[name=deleteAccount]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
$('input:checkbox[name=deleteAccount]').click(function(){
|
||||
$('input:checkbox[name=delete-all]').removeAttr('checked');
|
||||
});
|
||||
|
||||
// Confirmation alert for account deletion in userAccounts-list.ftl template
|
||||
$('input[name="delete-account"]').click(function(){
|
||||
var countAccount = $('input:checkbox[name=deleteAccount]:checked').length;
|
||||
if (countAccount == 0){
|
||||
return false;
|
||||
}else{
|
||||
var answer = confirm( ((countAccount > 1) ? confirm_delete_account_plural : confirm_delete_account_singular) +'?');
|
||||
return answer;
|
||||
}
|
||||
});
|
||||
|
||||
//Select role and filter
|
||||
$('#roleFilterUri').bind('change', function () {
|
||||
var url = $(this).val(); // get selected value
|
||||
if (url) { // require a URL
|
||||
window.location = url; // redirect
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -1,31 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
// Get the i18n variables from the template
|
||||
$.extend(this, i18nStrings);
|
||||
//Remove initial value of input text 'Select an existing last name'
|
||||
$('input[name="proxySelectorAC"]').click(function(){
|
||||
$(this).val('');
|
||||
$("span[name='proxySelectorSearchStatus']").text('')
|
||||
});
|
||||
|
||||
//Alert when user doesn't select an editor and a profile after submitting from for relating proxy-profiles
|
||||
$('input[name="createRelationship"]').click(function(){
|
||||
var $proxyUri = $('#add-relation input[name="proxyUri"]').val();
|
||||
var $profileUri = $('#add-relation input[name="profileUri"]').val();
|
||||
|
||||
if ($proxyUri == undefined || $profileUri == undefined){
|
||||
$('#error-alert').removeClass('hidden');
|
||||
|
||||
var $errorAlert = $('#error-alert p').html();
|
||||
|
||||
if ($errorAlert !=""){
|
||||
return false;
|
||||
}else{
|
||||
$('#error-alert p').append(i18nStrings.selectEditorAndProfile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
10
webapp/web/js/amplify/amplify.store.min.js
vendored
|
@ -1,10 +0,0 @@
|
|||
/*!
|
||||
* Amplify Store - Persistent Client-Side Storage 1.1.0
|
||||
*
|
||||
* Copyright 2011 appendTo LLC. (http://appendto.com/team)
|
||||
* Dual licensed under the MIT or GPL licenses.
|
||||
* http://appendto.com/open-source-licenses
|
||||
*
|
||||
* http://amplifyjs.com
|
||||
*/
|
||||
(function(a,b){function e(a,e){c.addType(a,function(f,g,h){var i,j,k,l,m=g,n=(new Date).getTime();if(!f){m={},l=[],k=0;try{f=e.length;while(f=e.key(k++))d.test(f)&&(j=JSON.parse(e.getItem(f)),j.expires&&j.expires<=n?l.push(f):m[f.replace(d,"")]=j.data);while(f=l.pop())e.removeItem(f)}catch(o){}return m}f="__amplify__"+f;if(g===b){i=e.getItem(f),j=i?JSON.parse(i):{expires:-1};if(j.expires&&j.expires<=n)e.removeItem(f);else return j.data}else if(g===null)e.removeItem(f);else{j=JSON.stringify({data:g,expires:h.expires?n+h.expires:null});try{e.setItem(f,j)}catch(o){c[a]();try{e.setItem(f,j)}catch(o){throw c.error()}}}return m})}var c=a.store=function(a,b,d,e){var e=c.type;d&&d.type&&d.type in c.types&&(e=d.type);return c.types[e](a,b,d||{})};c.types={},c.type=null,c.addType=function(a,b){c.type||(c.type=a),c.types[a]=b,c[a]=function(b,d,e){e=e||{},e.type=a;return c(b,d,e)}},c.error=function(){return"amplify.store quota exceeded"};var d=/^__amplify__/;for(var f in{localStorage:1,sessionStorage:1})try{window[f].getItem&&e(f,window[f])}catch(g){}if(window.globalStorage)try{e("globalStorage",window.globalStorage[window.location.hostname]),c.type==="sessionStorage"&&(c.type="globalStorage")}catch(g){}(function(){if(!c.types.localStorage){var a=document.createElement("div"),d="amplify";a.style.display="none",document.getElementsByTagName("head")[0].appendChild(a);try{a.addBehavior("#default#userdata"),a.load(d)}catch(e){a.parentNode.removeChild(a);return}c.addType("userData",function(e,f,g){a.load(d);var h,i,j,k,l,m=f,n=(new Date).getTime();if(!e){m={},l=[],k=0;while(h=a.XMLDocument.documentElement.attributes[k++])i=JSON.parse(h.value),i.expires&&i.expires<=n?l.push(h.name):m[h.name]=i.data;while(e=l.pop())a.removeAttribute(e);a.save(d);return m}e=e.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-");if(f===b){h=a.getAttribute(e),i=h?JSON.parse(h):{expires:-1};if(i.expires&&i.expires<=n)a.removeAttribute(e);else return i.data}else f===null?a.removeAttribute(e):(j=a.getAttribute(e),i=JSON.stringify({data:f,expires:g.expires?n+g.expires:null}),a.setAttribute(e,i));try{a.save(d)}catch(o){j===null?a.removeAttribute(e):a.setAttribute(e,j),c.userData();try{a.setAttribute(e,i),a.save(d)}catch(o){j===null?a.removeAttribute(e):a.setAttribute(e,j);throw c.error()}}return m})}})(),function(){function e(a){return a===b?b:JSON.parse(JSON.stringify(a))}var a={},d={};c.addType("memory",function(c,f,g){if(!c)return e(a);if(f===b)return e(a[c]);d[c]&&(clearTimeout(d[c]),delete d[c]);if(f===null){delete a[c];return null}a[c]=f,g.expires&&(d[c]=setTimeout(function(){delete a[c],delete d[c]},g.expires));return f})}()})(this.amplify=this.amplify||{})
|
|
@ -1,211 +0,0 @@
|
|||
/* 'Magic' date parsing, by Simon Willison (6th October 2003)
|
||||
http://simon.incutio.com/archive/2003/10/06/betterDateInput
|
||||
|
||||
example of usage:
|
||||
<form action="" method="get"><div>
|
||||
<input type="text" size="10" id="dateField" onblur="magicDate(this)"
|
||||
onfocus="if (this.className != 'error') this.select()">
|
||||
<div id="dateFieldMsg">mm/dd/yyyy</div>
|
||||
</div></form>
|
||||
*/
|
||||
|
||||
/* Finds the index of the first occurence of item in the array, or -1 if not found */
|
||||
Array.prototype.indexOf = function(item) {
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] == item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
/* Returns an array of items judged 'true' by the passed in test function */
|
||||
Array.prototype.filter = function(test) {
|
||||
var matches = [];
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (test(this[i])) {
|
||||
matches[matches.length] = this[i];
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
};
|
||||
|
||||
var monthNames = "January February March April May June July August September October November December".split(" ");
|
||||
var weekdayNames = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ");
|
||||
|
||||
/* Takes a string, returns the index of the month matching that string, throws
|
||||
an error if 0 or more than 1 matches
|
||||
*/
|
||||
function parseMonth(month) {
|
||||
var matches = monthNames.filter(function(item) {
|
||||
return new RegExp("^" + month, "i").test(item);
|
||||
});
|
||||
if (matches.length == 0) {
|
||||
throw new Error("Invalid month string");
|
||||
}
|
||||
if (matches.length > 1) {
|
||||
throw new Error("Ambiguous month");
|
||||
}
|
||||
return monthNames.indexOf(matches[0]);
|
||||
}
|
||||
/* Same as parseMonth but for days of the week */
|
||||
function parseWeekday(weekday) {
|
||||
var matches = weekdayNames.filter(function(item) {
|
||||
return new RegExp("^" + weekday, "i").test(item);
|
||||
});
|
||||
if (matches.length == 0) {
|
||||
throw new Error("Invalid day string");
|
||||
}
|
||||
if (matches.length > 1) {
|
||||
throw new Error("Ambiguous weekday");
|
||||
}
|
||||
return weekdayNames.indexOf(matches[0]);
|
||||
}
|
||||
|
||||
/* Array of objects, each has 're', a regular expression and 'handler', a
|
||||
function for creating a date from something that matches the regular
|
||||
expression. Handlers may throw errors if string is unparseable.
|
||||
*/
|
||||
var dateParsePatterns = [
|
||||
// Today
|
||||
{ re: /^tod/i,
|
||||
handler: function() {
|
||||
return new Date();
|
||||
}
|
||||
},
|
||||
// Tomorrow
|
||||
{ re: /^tom/i,
|
||||
handler: function() {
|
||||
var d = new Date();
|
||||
d.setDate(d.getDate() + 1);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// Yesterday
|
||||
{ re: /^yes/i,
|
||||
handler: function() {
|
||||
var d = new Date();
|
||||
d.setDate(d.getDate() - 1);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// 4th
|
||||
{ re: /^(\d{1,2})(st|nd|rd|th)?$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setDate(parseInt(bits[1], 10));
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// 4th Jan
|
||||
{ re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setDate(parseInt(bits[1], 10));
|
||||
d.setMonth(parseMonth(bits[2]));
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// 4th Jan 2003
|
||||
{ re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setDate(parseInt(bits[1], 10));
|
||||
d.setMonth(parseMonth(bits[2]));
|
||||
d.setYear(bits[3]);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// Jan 4th
|
||||
{ re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setDate(parseInt(bits[2], 10));
|
||||
d.setMonth(parseMonth(bits[1]));
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// Jan 4th 2003
|
||||
{ re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setDate(parseInt(bits[2], 10));
|
||||
d.setMonth(parseMonth(bits[1]));
|
||||
d.setYear(bits[3]);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// next Tuesday - this is suspect due to weird meaning of "next"
|
||||
{ re: /^next (\w+)$/i,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
var day = d.getDay();
|
||||
var newDay = parseWeekday(bits[1]);
|
||||
var addDays = newDay - day;
|
||||
if (newDay <= day) {
|
||||
addDays += 7;
|
||||
}
|
||||
d.setDate(d.getDate() + addDays);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// last Tuesday
|
||||
{ re: /^last (\w+)$/i,
|
||||
handler: function(bits) {
|
||||
throw new Error("Not yet implemented");
|
||||
}
|
||||
},
|
||||
// mm/dd/yyyy (American style)
|
||||
{ re: /(\d{1,2})\/(\d{1,2})\/(\d{4})/,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setYear(bits[3]);
|
||||
d.setDate(parseInt(bits[2], 10));
|
||||
d.setMonth(parseInt(bits[1], 10) - 1); // Because months indexed from 0
|
||||
return d;
|
||||
}
|
||||
},
|
||||
// yyyy-mm-dd (ISO style)
|
||||
{ re: /(\d{4})-(\d{1,2})-(\d{1,2})/,
|
||||
handler: function(bits) {
|
||||
var d = new Date();
|
||||
d.setYear(parseInt(bits[1]));
|
||||
d.setDate(parseInt(bits[3], 10));
|
||||
d.setMonth(parseInt(bits[2], 10) - 1);
|
||||
return d;
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
function parseDateString(s) {
|
||||
for (var i = 0; i < dateParsePatterns.length; i++) {
|
||||
var re = dateParsePatterns[i].re;
|
||||
var handler = dateParsePatterns[i].handler;
|
||||
var bits = re.exec(s);
|
||||
if (bits) {
|
||||
return handler(bits);
|
||||
}
|
||||
}
|
||||
throw new Error("Invalid date string" + s);
|
||||
}
|
||||
|
||||
function magicDate(input) {
|
||||
var messagespan = input.id + 'Msg';
|
||||
try {
|
||||
var d = parseDateString(input.value);
|
||||
input.value = (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear();
|
||||
input.className = '';
|
||||
// Human readable date
|
||||
document.getElementById(messagespan).firstChild.nodeValue = d.toDateString();
|
||||
document.getElementById(messagespan).className = 'normal';
|
||||
}
|
||||
catch (e) {
|
||||
input.className = 'error';
|
||||
var message = e.message;
|
||||
// Fix for IE6 bug
|
||||
if (message.indexOf('is null or not an object') > -1) {
|
||||
message = 'Invalid date string';
|
||||
}
|
||||
document.getElementById(messagespan).firstChild.nodeValue = message;
|
||||
document.getElementById(messagespan).className = 'error';
|
||||
}
|
||||
}
|
|
@ -1,202 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
|
||||
var browseClassGroups = {
|
||||
// Initial page setup
|
||||
onLoad: function() {
|
||||
this.mergeFromTemplate();
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
},
|
||||
|
||||
// Add variables from browse template
|
||||
mergeFromTemplate: function() {
|
||||
$.extend(this, browseData);
|
||||
$.extend(this, i18nStrings);
|
||||
},
|
||||
|
||||
// Create references to frequently used elements for convenience
|
||||
initObjects: function() {
|
||||
this.vClassesInClassGroup = $('ul#classes-in-classgroup');
|
||||
this.browseClassGroupLinks = $('#browse-classgroups li a');
|
||||
this.browseClasses = $('#browse-classes');
|
||||
},
|
||||
|
||||
// Event listeners. Called on page load
|
||||
bindEventListeners: function() {
|
||||
// Listener for classGroup switching
|
||||
this.browseClassGroupLinks.click(function() {
|
||||
uri = $(this).attr("data-uri");
|
||||
individualCount = $(this).attr("data-count");
|
||||
browseClassGroups.getVClasses(uri, individualCount);
|
||||
return false;
|
||||
});
|
||||
|
||||
// Call the bar chart highlighter listener
|
||||
this.chartHighlighterListener();
|
||||
},
|
||||
|
||||
// Listener for bar chart highlighting -- separate from the rest because it needs to be callable
|
||||
chartHighlighterListener: function() {
|
||||
// This essentially replicates the native Raphael hover behavior (see chart.hover below)
|
||||
// but allows us to trigger it via jQuery from the list of classes adjacent to the chart
|
||||
$('ul#classes-in-classgroup li a').hover(function() {
|
||||
var classIndex = $('ul#classes-in-classgroup li a').index(this);
|
||||
$('#visual-graph svg path').eq(classIndex).attr('fill', '#ccc');
|
||||
return false;
|
||||
}, function() {
|
||||
var classIndex = $('ul#classes-in-classgroup li a').index(this);
|
||||
$('#visual-graph svg path').eq(classIndex).attr('fill', '#999');
|
||||
})
|
||||
},
|
||||
|
||||
// Load classes and chart for default class group as defined by template
|
||||
defaultClassGroup: function() {
|
||||
if ( this.defaultBrowseClassGroupURI != "false" ) {
|
||||
this.getVClasses(this.defaultBrowseClassGroupUri, this.defaultBrowseClassGroupCount);
|
||||
}
|
||||
},
|
||||
|
||||
// Where all the magic happens -- gonna fetch me some classes
|
||||
getVClasses: function(classgroupUri, classGroupIndivCount) {
|
||||
url = this.dataServiceUrl + encodeURIComponent(classgroupUri);
|
||||
|
||||
// First wipe currently displayed classes, browse all link, and bar chart
|
||||
this.vClassesInClassGroup.empty();
|
||||
$('a.browse-superclass').remove();
|
||||
$('#visual-graph').empty();
|
||||
|
||||
var values = [],
|
||||
labels = [],
|
||||
uris = [],
|
||||
classList = [],
|
||||
populatedClasses = 0;
|
||||
potentialSuperClasses = [];
|
||||
|
||||
$.getJSON(url, function(results) {
|
||||
|
||||
$.each(results.classes, function(i, item) {
|
||||
name = results.classes[i].name;
|
||||
uri = results.classes[i].URI;
|
||||
indivCount = results.classes[i].entityCount;
|
||||
indexUrl = browseClassGroups.baseUrl +'/individuallist?vclassId='+ encodeURIComponent(uri);
|
||||
// Only add to the arrays and render classes when they aren't empty
|
||||
if ( indivCount > 0 ) {
|
||||
// if the class individual count is equal to the class group individual count, this could be a super class
|
||||
if ( indivCount == classGroupIndivCount ) {
|
||||
potentialSuperClasses.push(populatedClasses);
|
||||
}
|
||||
|
||||
values.push(parseInt(indivCount, 10));
|
||||
labels.push(name);
|
||||
uris.push(uri);
|
||||
|
||||
// Build the content of each list item, piecing together each component
|
||||
listItem = '<li role="listitem">';
|
||||
listItem += '<a href="'+ indexUrl +'" title="' + browseClassGroups.browseAllString + ' '
|
||||
+ name + ' ' + browseClassGroups.contentString + '">'+ name +'</a>';
|
||||
listItem += '</li>';
|
||||
|
||||
// Add the list item to the array of classes
|
||||
classList.push(listItem);
|
||||
|
||||
populatedClasses++;
|
||||
}
|
||||
})
|
||||
|
||||
// Test for number of potential super classes. If only 1, then remove it from all arrays
|
||||
// But only do so if there are at least 2 classes in the list to begin with
|
||||
if ( classList.length > 1 && potentialSuperClasses.length == 1 ){
|
||||
// Grab the URI of the super class before splicing
|
||||
superClassUri = uris[potentialSuperClasses];
|
||||
|
||||
values.splice(potentialSuperClasses, 1);
|
||||
labels.splice(potentialSuperClasses, 1);
|
||||
uris.splice(potentialSuperClasses, 1);
|
||||
classList.splice(potentialSuperClasses, 1);
|
||||
|
||||
browseAllUrl = browseClassGroups.baseUrl +'/individuallist?vclassId='+ encodeURIComponent(superClassUri);
|
||||
browseAllLink = '<a class="browse-superclass" href="'+ browseAllUrl +'" title="'
|
||||
+ browseClassGroups.browseAllString + ' ' + results.classGroupName
|
||||
+ '">' + browseClassGroups.browseAllString + ' »</a>';
|
||||
browseClassGroups.browseClasses.prepend(browseAllLink);
|
||||
}
|
||||
|
||||
// Add the classes to the DOM
|
||||
$.each(classList, function(i, listItem) {
|
||||
browseClassGroups.vClassesInClassGroup.append(listItem);
|
||||
})
|
||||
|
||||
// Set selected class group
|
||||
browseClassGroups.selectedClassGroup(results.classGroupUri);
|
||||
|
||||
// Update the graph
|
||||
graphClassGroups.barchart(values, labels, uris);
|
||||
|
||||
// Call the bar highlighter listener
|
||||
browseClassGroups.chartHighlighterListener();
|
||||
});
|
||||
},
|
||||
|
||||
// Toggle the active class group so it's clear which is selected
|
||||
selectedClassGroup: function(classGroupUri) {
|
||||
// Remove active class on all vClasses
|
||||
$('#browse-classgroups li a.selected').removeClass('selected');
|
||||
|
||||
// Add active class for requested vClass
|
||||
$('#browse-classgroups li a[data-uri="'+ classGroupUri +'"]').addClass('selected');
|
||||
}
|
||||
};
|
||||
|
||||
var graphClassGroups = {
|
||||
// Build the bar chart using gRaphael
|
||||
barchart: function(values, labels, uris) {
|
||||
var height = values.length * 37;
|
||||
|
||||
// Create the canvas
|
||||
var r = Raphael("visual-graph", 225, height + 10);
|
||||
|
||||
var chart = r.g.hbarchart(0, 16, 225, height, [values], {type:"soft", singleColor:"#999"});
|
||||
|
||||
// Was unable to append <a> within <svg> -- was always hidden and couldn't get it to display
|
||||
// so using jQuery click to add links
|
||||
$('rect').click(function() {
|
||||
var index = $('rect').index(this);
|
||||
var uri = uris[index];
|
||||
var link = browseClassGroups.baseUrl + '/individuallist?vclassId=' + encodeURIComponent(uri);
|
||||
window.location = link;
|
||||
});
|
||||
|
||||
// Add title attributes to each <rect> in the bar chart
|
||||
$('rect').each(function() {
|
||||
var index = $('rect').index(this);
|
||||
var label = labels[index];
|
||||
var title = browseClassGroups.browseAllString + ' ' + label + ' ' + browseClassGroups.contentString;
|
||||
|
||||
// Add a title attribute
|
||||
$(this).attr('title', title);
|
||||
});
|
||||
|
||||
// On hover
|
||||
// 1. Change bar color
|
||||
// 2. Highlight class name in main list
|
||||
chart.hover(function() {
|
||||
this.bar.attr({fill: "#ccc"});
|
||||
$('rect').hover(function() {
|
||||
var index = $('rect').index(this);
|
||||
$('#classes-in-classgroup li a').eq(index).addClass('selected');
|
||||
})
|
||||
}, function() {
|
||||
this.bar.attr({fill: "#999"});
|
||||
$('rect').hover(function() {
|
||||
var index = $('rect').index(this);
|
||||
$('#classes-in-classgroup li a').eq(index).removeClass('selected');
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
browseClassGroups.onLoad();
|
||||
browseClassGroups.defaultClassGroup();
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var vitro;
|
||||
// vitro == null: true
|
||||
// vitro === null: false (only true if undefined)
|
||||
// typeof vitro == 'undefined': true
|
||||
if (!vitro) {
|
||||
vitro = {};
|
||||
}
|
||||
|
||||
vitro.browserUtils = {
|
||||
|
||||
isIELessThan8: function() {
|
||||
var version;
|
||||
if (navigator.appVersion.indexOf("MSIE") == -1) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
version = parseFloat(navigator.appVersion.split("MSIE")[1]);
|
||||
return version < 8;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
function ValidateForm(formName) {
|
||||
var x = 0; // counts form elements - used as array index
|
||||
var y = 0; // counts required fields - used as array index
|
||||
errors = false;
|
||||
var errorList;
|
||||
|
||||
// Check for Email formatting
|
||||
if (document.forms[formName].EmailFields) {
|
||||
errorList = '\n' + i18nStrings.pleaseFormatEmail + '\n\n \"userid@institution.edu\" \n\n'
|
||||
+ i18nStrings.enterValidAddress;
|
||||
// build array of required fields
|
||||
emailStr = document.forms[formName].EmailFields.value;
|
||||
emailFields = emailStr.split(',');
|
||||
// build array holding the names of required fields as
|
||||
// displayed in error box
|
||||
if (document.forms[formName].EmailFieldsNames) {
|
||||
emailNameStr = document.forms[formName].EmailFieldsNames.value;
|
||||
} else {
|
||||
emailNameStr = document.forms[formName].EmailFields.value;
|
||||
}
|
||||
emailNames = emailNameStr.split(',');
|
||||
// Loop through form elements, checking for required fields
|
||||
while ((x < document.forms[formName].elements.length)) {
|
||||
if (document.forms[formName].elements[x].name == emailFields[y]) {
|
||||
if ((document.forms[formName].elements[x].value.indexOf('@') < 1)
|
||||
|| (document.forms[formName].elements[x].value.lastIndexOf('.') < document.forms[formName].elements[x].value.indexOf('@')+1)) {
|
||||
errors = true;
|
||||
}
|
||||
y++;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
if (errors) {
|
||||
alert(errorList);
|
||||
return false;
|
||||
}
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
||||
|
||||
<%
|
||||
String contextPath = request.getContextPath();
|
||||
%>
|
||||
|
||||
<script language="JavaScript" type="text/javascript" src="<%= contextPath %>/js/commentForm.js"></script>
|
|
@ -1,75 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var vitro;
|
||||
|
||||
// vitro == null: true
|
||||
// vitro === null: false (only true if undefined)
|
||||
// typeof vitro == 'undefined': true
|
||||
if (!vitro) {
|
||||
vitro = {};
|
||||
}
|
||||
|
||||
vitro.customFormUtils = {
|
||||
|
||||
hideForm: function() {
|
||||
this.hideFields(this.form);
|
||||
},
|
||||
|
||||
clearFormData: function() {
|
||||
this.clearFields(this.form);
|
||||
},
|
||||
|
||||
// This method should always be called instead of calling hide() directly on any
|
||||
// element containing form fields.
|
||||
hideFields: function(el) {
|
||||
// Clear any input and error messages, so if we re-show the element it won't still be there.
|
||||
this.clearFields(el);
|
||||
el.hide();
|
||||
},
|
||||
|
||||
// Clear data from form elements in element el
|
||||
clearFields: function(el) {
|
||||
el.find(':input[type!="hidden"][type!="submit"][type!="button"]').each(function() {
|
||||
$(this).val('');
|
||||
// Remove a validation error associated with this element.
|
||||
// For now we can remove the error elements. Later we may include them in
|
||||
// the markup, for customized positioning, in which case we will empty them
|
||||
// but not remove them here. See findValidationErrors().
|
||||
$('[id=' + $(this).attr('id') + '_validationError]').remove();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// Return true iff there are validation errors on the form
|
||||
//Updating to include new functionality where errors are on top of page
|
||||
findValidationErrors: function() {
|
||||
var validationErrorSection = $('#error-alert');
|
||||
if(validationErrorSection.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return this.form.find('.validationError').length > 0;
|
||||
|
||||
// RY For now, we just need to look for the presence of the error elements.
|
||||
// Later, however, we may generate empty error messages in the markup, for
|
||||
// customized positioning, in which case we need to look for whether they have
|
||||
// content. See clearFormData().
|
||||
// var foundErrors = false,
|
||||
// errors = this.form.find('.validationError'),
|
||||
// numErrors = errors.length,
|
||||
// i,
|
||||
// error;
|
||||
//
|
||||
// for (i = 0; foundErrors == false && i < numErrors; i++) {
|
||||
// error = errors[i];
|
||||
// if (error.html() != '') {
|
||||
// foundErrors = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return foundErrors;
|
||||
},
|
||||
|
||||
capitalize: function(word) {
|
||||
return word.substring(0, 1).toUpperCase() + word.substring(1);
|
||||
}
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
/* from Nicholas C. Zakas 2005 */
|
||||
/* ch 10 browser detection */
|
||||
/* downloaded from wrox.com by bdc34 */
|
||||
var sUserAgent = navigator.userAgent;
|
||||
var fAppVersion = parseFloat(navigator.appVersion);
|
||||
|
||||
function compareVersions(sVersion1, sVersion2) {
|
||||
|
||||
var aVersion1 = sVersion1.split(".");
|
||||
var aVersion2 = sVersion2.split(".");
|
||||
|
||||
if (aVersion1.length > aVersion2.length) {
|
||||
for (var i=0; i < aVersion1.length - aVersion2.length; i++) {
|
||||
aVersion2.push("0");
|
||||
}
|
||||
} else if (aVersion1.length < aVersion2.length) {
|
||||
for (var i=0; i < aVersion2.length - aVersion1.length; i++) {
|
||||
aVersion1.push("0");
|
||||
}
|
||||
}
|
||||
|
||||
for (var i=0; i < aVersion1.length; i++) {
|
||||
|
||||
if (aVersion1[i] < aVersion2[i]) {
|
||||
return -1;
|
||||
} else if (aVersion1[i] > aVersion2[i]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
var isOpera = sUserAgent.indexOf("Opera") > -1;
|
||||
var isMinOpera4 = isMinOpera5 = isMinOpera6 = isMinOpera7 = isMinOpera7_5 = false;
|
||||
|
||||
if (isOpera) {
|
||||
var fOperaVersion;
|
||||
if(navigator.appName == "Opera") {
|
||||
fOperaVersion = fAppVersion;
|
||||
} else {
|
||||
var reOperaVersion = new RegExp("Opera (\\d+\\.\\d+)");
|
||||
reOperaVersion.test(sUserAgent);
|
||||
fOperaVersion = parseFloat(RegExp["$1"]);
|
||||
}
|
||||
|
||||
isMinOpera4 = fOperaVersion >= 4;
|
||||
isMinOpera5 = fOperaVersion >= 5;
|
||||
isMinOpera6 = fOperaVersion >= 6;
|
||||
isMinOpera7 = fOperaVersion >= 7;
|
||||
isMinOpera7_5 = fOperaVersion >= 7.5;
|
||||
}
|
||||
|
||||
var isKHTML = sUserAgent.indexOf("KHTML") > -1
|
||||
|| sUserAgent.indexOf("Konqueror") > -1
|
||||
|| sUserAgent.indexOf("AppleWebKit") > -1;
|
||||
|
||||
var isMinSafari1 = isMinSafari1_2 = false;
|
||||
var isMinKonq2_2 = isMinKonq3 = isMinKonq3_1 = isMinKonq3_2 = false;
|
||||
|
||||
if (isKHTML) {
|
||||
isSafari = sUserAgent.indexOf("AppleWebKit") > -1;
|
||||
isKonq = sUserAgent.indexOf("Konqueror") > -1;
|
||||
|
||||
if (isSafari) {
|
||||
var reAppleWebKit = new RegExp("AppleWebKit\\/(\\d+(?:\\.\\d*)?)");
|
||||
reAppleWebKit.test(sUserAgent);
|
||||
var fAppleWebKitVersion = parseFloat(RegExp["$1"]);
|
||||
|
||||
isMinSafari1 = fAppleWebKitVersion >= 85;
|
||||
isMinSafari1_2 = fAppleWebKitVersion >= 124;
|
||||
} else if (isKonq) {
|
||||
|
||||
var reKonq = new RegExp("Konqueror\\/(\\d+(?:\\.\\d+(?:\\.\\d)?)?)");
|
||||
reKonq.test(sUserAgent);
|
||||
isMinKonq2_2 = compareVersions(RegExp["$1"], "2.2") >= 0;
|
||||
isMinKonq3 = compareVersions(RegExp["$1"], "3.0") >= 0;
|
||||
isMinKonq3_1 = compareVersions(RegExp["$1"], "3.1") >= 0;
|
||||
isMinKonq3_2 = compareVersions(RegExp["$1"], "3.2") >= 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var isIE = sUserAgent.indexOf("compatible") > -1
|
||||
&& sUserAgent.indexOf("MSIE") > -1
|
||||
&& !isOpera;
|
||||
|
||||
var isMinIE4 = isMinIE5 = isMinIE5_5 = isMinIE6 = false;
|
||||
|
||||
if (isIE) {
|
||||
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
|
||||
reIE.test(sUserAgent);
|
||||
var fIEVersion = parseFloat(RegExp["$1"]);
|
||||
|
||||
isMinIE4 = fIEVersion >= 4;
|
||||
isMinIE5 = fIEVersion >= 5;
|
||||
isMinIE5_5 = fIEVersion >= 5.5;
|
||||
isMinIE6 = fIEVersion >= 6.0;
|
||||
}
|
||||
|
||||
var isMoz = sUserAgent.indexOf("Gecko") > -1
|
||||
&& !isKHTML;
|
||||
|
||||
var isMinMoz1 = sMinMoz1_4 = isMinMoz1_5 = false;
|
||||
|
||||
if (isMoz) {
|
||||
var reMoz = new RegExp("rv:(\\d+\\.\\d+(?:\\.\\d+)?)");
|
||||
reMoz.test(sUserAgent);
|
||||
isMinMoz1 = compareVersions(RegExp["$1"], "1.0") >= 0;
|
||||
isMinMoz1_4 = compareVersions(RegExp["$1"], "1.4") >= 0;
|
||||
isMinMoz1_5 = compareVersions(RegExp["$1"], "1.5") >= 0;
|
||||
}
|
||||
|
||||
var isNS4 = !isIE && !isOpera && !isMoz && !isKHTML
|
||||
&& (sUserAgent.indexOf("Mozilla") == 0)
|
||||
&& (navigator.appName == "Netscape")
|
||||
&& (fAppVersion >= 4.0 && fAppVersion < 5.0);
|
||||
|
||||
var isMinNS4 = isMinNS4_5 = isMinNS4_7 = isMinNS4_8 = false;
|
||||
|
||||
if (isNS4) {
|
||||
isMinNS4 = true;
|
||||
isMinNS4_5 = fAppVersion >= 4.5;
|
||||
isMinNS4_7 = fAppVersion >= 4.7;
|
||||
isMinNS4_8 = fAppVersion >= 4.8;
|
||||
}
|
||||
|
||||
var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
|
||||
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC")
|
||||
|| (navigator.platform == "Macintosh");
|
||||
|
||||
var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
|
||||
|
||||
var isWin95 = isWin98 = isWinNT4 = isWin2K = isWinME = isWinXP = false;
|
||||
var isMac68K = isMacPPC = false;
|
||||
var isSunOS = isMinSunOS4 = isMinSunOS5 = isMinSunOS5_5 = false;
|
||||
|
||||
if (isWin) {
|
||||
isWin95 = sUserAgent.indexOf("Win95") > -1
|
||||
|| sUserAgent.indexOf("Windows 95") > -1;
|
||||
isWin98 = sUserAgent.indexOf("Win98") > -1
|
||||
|| sUserAgent.indexOf("Windows 98") > -1;
|
||||
isWinME = sUserAgent.indexOf("Win 9x 4.90") > -1
|
||||
|| sUserAgent.indexOf("Windows ME") > -1;
|
||||
isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1
|
||||
|| sUserAgent.indexOf("Windows 2000") > -1;
|
||||
isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1
|
||||
|| sUserAgent.indexOf("Windows XP") > -1;
|
||||
isWinNT4 = sUserAgent.indexOf("WinNT") > -1
|
||||
|| sUserAgent.indexOf("Windows NT") > -1
|
||||
|| sUserAgent.indexOf("WinNT4.0") > -1
|
||||
|| sUserAgent.indexOf("Windows NT 4.0") > -1
|
||||
&& (!isWinME && !isWin2K && !isWinXP);
|
||||
}
|
||||
|
||||
if (isMac) {
|
||||
isMac68K = sUserAgent.indexOf("Mac_68000") > -1
|
||||
|| sUserAgent.indexOf("68K") > -1;
|
||||
isMacPPC = sUserAgent.indexOf("Mac_PowerPC") > -1
|
||||
|| sUserAgent.indexOf("PPC") > -1;
|
||||
}
|
||||
|
||||
if (isUnix) {
|
||||
isSunOS = sUserAgent.indexOf("SunOS") > -1;
|
||||
|
||||
if (isSunOS) {
|
||||
var reSunOS = new RegExp("SunOS (\\d+\\.\\d+(?:\\.\\d+)?)");
|
||||
reSunOS.test(sUserAgent);
|
||||
isMinSunOS4 = compareVersions(RegExp["$1"], "4.0") >= 0;
|
||||
isMinSunOS5 = compareVersions(RegExp["$1"], "5.0") >= 0;
|
||||
isMinSunOS5_5 = compareVersions(RegExp["$1"], "5.5") >= 0;
|
||||
}
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
function DeveloperPanel(developerAjaxUrl) {
|
||||
this.setupDeveloperPanel = updateDeveloperPanel;
|
||||
|
||||
function updateDeveloperPanel(data) {
|
||||
$.ajax({
|
||||
url: developerAjaxUrl,
|
||||
dataType: "html",
|
||||
data: data,
|
||||
complete: function(xhr, status) {
|
||||
updatePanelContents(xhr.responseText);
|
||||
if (document.getElementById("developerPanelSaveButton")) {
|
||||
initializeTabs();
|
||||
addBehaviorToElements();
|
||||
updateDisabledFields();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updatePanelContents(contents) {
|
||||
document.getElementById("developerPanel").innerHTML = contents;
|
||||
}
|
||||
|
||||
function initializeTabs() {
|
||||
$("#developerTabs").tabs();
|
||||
}
|
||||
|
||||
function addBehaviorToElements() {
|
||||
$( "#developerPanelClickMe" ).click(openPanel);
|
||||
$( "#developerPanelSaveButton" ).click(saveSettings);
|
||||
$( "#developerPanelBody input:checkbox" ).change(updateDisabledFields);
|
||||
}
|
||||
|
||||
function openPanel() {
|
||||
$( "#developerPanelClickText" ).hide();
|
||||
$( "#developerPanelBody" ).show();
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
$( "#developerPanelBody" ).hide();
|
||||
updateDeveloperPanel(collectFormData());
|
||||
}
|
||||
|
||||
function updateDisabledFields() {
|
||||
var developerEnabled = document.getElementById("developer_enabled").checked;
|
||||
document.getElementById("developer_permitAnonymousControl").disabled = !developerEnabled;
|
||||
document.getElementById("developer_defeatFreemarkerCache").disabled = !developerEnabled;
|
||||
document.getElementById("developer_insertFreemarkerDelimiters").disabled = !developerEnabled;
|
||||
document.getElementById("developer_pageContents_logCustomListView").disabled = !developerEnabled;
|
||||
document.getElementById("developer_pageContents_logCustomShortView").disabled = !developerEnabled;
|
||||
document.getElementById("developer_i18n_defeatCache").disabled = !developerEnabled;
|
||||
document.getElementById("developer_i18n_logStringRequests").disabled = !developerEnabled;
|
||||
document.getElementById("developer_loggingRDFService_enable").disabled = !developerEnabled;
|
||||
document.getElementById("developer_searchIndex_enable").disabled = !developerEnabled;
|
||||
document.getElementById("developer_searchIndex_logIndexingBreakdownTimings").disabled = !developerEnabled;
|
||||
document.getElementById("developer_searchIndex_suppressModelChangeListener").disabled = !developerEnabled;
|
||||
document.getElementById("developer_searchDeletions_enable").disabled = !developerEnabled;
|
||||
document.getElementById("developer_searchEngine_enable").disabled = !developerEnabled;
|
||||
document.getElementById("developer_authorization_logDecisions_enable").disabled = !developerEnabled;
|
||||
|
||||
var rdfServiceEnabled = developerEnabled && document.getElementById("developer_loggingRDFService_enable").checked;
|
||||
document.getElementById("developer_loggingRDFService_stackTrace").disabled = !rdfServiceEnabled;
|
||||
document.getElementById("developer_loggingRDFService_queryRestriction").disabled = !rdfServiceEnabled;
|
||||
document.getElementById("developer_loggingRDFService_stackRestriction").disabled = !rdfServiceEnabled;
|
||||
|
||||
var searchIndexEnabled = developerEnabled && document.getElementById("developer_searchIndex_enable").checked;
|
||||
document.getElementById("developer_searchIndex_showDocuments").disabled = !searchIndexEnabled;
|
||||
document.getElementById("developer_searchIndex_uriOrNameRestriction").disabled = !searchIndexEnabled;
|
||||
document.getElementById("developer_searchIndex_documentRestriction").disabled = !searchIndexEnabled;
|
||||
|
||||
var searchEngineEnabled = developerEnabled && document.getElementById("developer_searchEngine_enable").checked;
|
||||
document.getElementById("developer_searchEngine_addStackTrace").disabled = !searchEngineEnabled;
|
||||
document.getElementById("developer_searchEngine_addResults").disabled = !searchEngineEnabled;
|
||||
document.getElementById("developer_searchEngine_queryRestriction").disabled = !searchEngineEnabled;
|
||||
document.getElementById("developer_searchEngine_stackRestriction").disabled = !searchEngineEnabled;
|
||||
|
||||
var authLoggingEnabled = developerEnabled && document.getElementById("developer_authorization_logDecisions_enable").checked;
|
||||
document.getElementById("developer_authorization_logDecisions_skipInconclusive").disabled = !authLoggingEnabled;
|
||||
document.getElementById("developer_authorization_logDecisions_addIdentifiers").disabled = !authLoggingEnabled;
|
||||
document.getElementById("developer_authorization_logDecisions_actionRestriction").disabled = !authLoggingEnabled;
|
||||
document.getElementById("developer_authorization_logDecisions_policyRestriction").disabled = !authLoggingEnabled;
|
||||
document.getElementById("developer_authorization_logDecisions_userRestriction").disabled = !authLoggingEnabled;
|
||||
}
|
||||
|
||||
function collectFormData() {
|
||||
var data = new Object();
|
||||
$( "#developerPanelBody [type=checkbox]" ).each(function(i, element){
|
||||
data[element.id] = element.checked;
|
||||
});
|
||||
$( "#developerPanelBody [type=text]" ).each(function(i, element){
|
||||
data[element.id] = element.value;
|
||||
});
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Relies on the global variables for the AJAX URL and the CSS files.
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$.each(developerCssLinks, function(index, value){
|
||||
var cssLink = $("<link rel='stylesheet' type='text/css' href='" + value + "'>");
|
||||
$("head").append(cssLink);
|
||||
});
|
||||
|
||||
new DeveloperPanel(developerAjaxUrl).setupDeveloperPanel();
|
||||
});
|
||||
|
|
@ -1,357 +0,0 @@
|
|||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<!-- <script type='text/javascript' src='dojo.js'></script> -->
|
||||
|
||||
<script language="JavaScript">
|
||||
function confirmDelete() {
|
||||
var msg="Are you SURE you want to delete this individual? If in doubt, CANCEL."
|
||||
return confirm(msg);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type='text/javascript' src='dwr/interface/EntityDWR.js'></script>
|
||||
<script type='text/javascript' src='dwr/engine.js'></script>
|
||||
<script type='text/javascript' src='dwr/util.js'></script>
|
||||
<script type='text/javascript' src='js/vitro.js'></script>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
if( vitroJsLoaded == null ){
|
||||
|
||||
alert("seminar.js needs to have the code from vitro.js loaded first");
|
||||
|
||||
}
|
||||
|
||||
// addEvent(window, 'load', monikerInit);
|
||||
|
||||
function monikerInit(){
|
||||
|
||||
// if ($('monikerSelect').options.length=1) {
|
||||
// $('monikerSelectAlt').disabled = false;
|
||||
// }else{
|
||||
// $('monikerSelectAlt').disabled = true;
|
||||
// }
|
||||
|
||||
$('Moniker').onchange = checkMonikers;
|
||||
|
||||
update();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function update(){ //updates moniker list when type is changed
|
||||
|
||||
DWRUtil.useLoadingMessage();
|
||||
|
||||
EntityDWR.monikers(createList, document.getElementById("VClassURI").value );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createList(data) { //puts options in moniker select list
|
||||
|
||||
fillList("Moniker", data, getCurrentMoniker() );
|
||||
|
||||
var ele = $("Moniker");
|
||||
|
||||
var opt = new Option("none","");
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
var opt = new Option("[new moniker]","");
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
DWRUtil.setValue("Moniker",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
||||
|
||||
checkMonikers();
|
||||
}
|
||||
|
||||
function getCurrentMoniker() {
|
||||
return document.getElementById("MonikerSelectAlt").value;
|
||||
}
|
||||
|
||||
|
||||
function checkMonikers(){ //checks if monikers is on [new moniker] and enables alt field
|
||||
|
||||
var sel = $('Moniker');
|
||||
|
||||
if( sel.value == "" || sel.options.length <= 1){
|
||||
$('MonikerSelectAlt').disabled = false;
|
||||
|
||||
}else{
|
||||
|
||||
$('MonikerSelectAlt').disabled = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fillList(id, data, selectedtext) {
|
||||
|
||||
var ele = $(id);
|
||||
|
||||
if (ele == null) {
|
||||
|
||||
alert("fillList() can't find an element with id: " + id + ".");
|
||||
|
||||
throw id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ele.options.length = 0; // Empty the list
|
||||
|
||||
if (data == null) { return; }
|
||||
|
||||
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
|
||||
var text = DWRUtil.toDescriptiveString(data[i]);
|
||||
|
||||
var value = text;
|
||||
|
||||
|
||||
|
||||
var opt = new Option(text, value);
|
||||
|
||||
if (selectedtext != null && selectedtext == text){
|
||||
|
||||
opt.selected=true;
|
||||
|
||||
}
|
||||
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script language="javascript" type="text/javascript" src="js/toggle.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
|
||||
|
||||
tinyMCE.init({
|
||||
theme : "advanced",
|
||||
mode : "exact",
|
||||
elements : "Description",
|
||||
theme_advanced_buttons1 : "bold,italic,underline,separator,link,bullist,numlist,separator,sub,sup,charmap,separator,undo,redo,separator,removeformat,cleanup,help,code",
|
||||
theme_advanced_buttons2 : "",
|
||||
theme_advanced_buttons3 : "",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_resizing : true,
|
||||
height : "10",
|
||||
width : "95%",
|
||||
valid_elements : "a[href|target|name|title],br,p,i,em,cite,strong/b,u,sub,sup,ul,ol,li,h2,h3,h4,h5,h6",
|
||||
forced_root_block: false
|
||||
|
||||
// elements : "elm1,elm2",
|
||||
// save_callback : "customSave",
|
||||
// content_css : "example_advanced.css",
|
||||
// extended_valid_elements : "a[href|target|name]",
|
||||
// plugins : "table",
|
||||
// theme_advanced_buttons3_add_before : "tablecontrols,separator",
|
||||
// invalid_elements : "li",
|
||||
// theme_advanced_styles : "Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1", // Theme specific setting CSS classes
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
/*
|
||||
dojo.require("dojo.dom.*");
|
||||
*/
|
||||
|
||||
nextId=99999;
|
||||
// fix this with separate values per type
|
||||
|
||||
function getAllChildren(theNode, childArray) {
|
||||
var ImmediateChildren = theNode.childNodes;
|
||||
if (ImmediateChildren) {
|
||||
for (var i=0;i<ImmediateChildren.length;i++) {
|
||||
childArray.push(ImmediateChildren[i]);
|
||||
getAllChildren(ImmediateChildren[i],childArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addLine(baseNode, typeStr)
|
||||
{
|
||||
baseId = baseNode.id.substr(0,baseNode.id.length-7);
|
||||
newTaName = document.getElementById(baseId+"genTaName").firstChild.nodeValue;
|
||||
theList = document.getElementById(baseId+"ul");
|
||||
nextId++;
|
||||
TrId = nextId;
|
||||
templateRoot = document.getElementById(typeStr+"NN");
|
||||
newRow = templateRoot.cloneNode(true);
|
||||
// newRow.id = newRow.id.substr(0,newRow.id.length-2)+TrId;
|
||||
newRow.id=TrId;
|
||||
newRowChildren = new Array();
|
||||
getAllChildren(newRow,newRowChildren);
|
||||
for (i=0;i<newRowChildren.length;i++) {
|
||||
if (newRowChildren[i].id) {
|
||||
if(newRowChildren[i].id.substr(0,typeStr.length+2)==typeStr+"NN") {
|
||||
newRowChildren[i].id=TrId+newRowChildren[i].id.substr(typeStr.length+2,newRowChildren[i].id.length-typeStr.length-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
theList.appendChild(newRow);
|
||||
theContent=document.getElementById(TrId+"content");
|
||||
theContent.style.display="none";
|
||||
theContentValue=document.getElementById(TrId+"contentValue");
|
||||
theTaTa = document.getElementById(TrId+"tata");
|
||||
theTaTa.name=newTaName;
|
||||
theTaTa.style.display="block";
|
||||
theTa = document.getElementById(TrId+"ta");
|
||||
theTa.style.display="block";
|
||||
|
||||
// scroll the window to make sure the user sees our new textarea
|
||||
var coors = findPos(theTaTa);
|
||||
window.scrollTo(coors[0]-150,coors[1]-150);
|
||||
|
||||
// switch the textarea to a TinyMCE instance
|
||||
tinyMCE.execCommand('mceAddControl',false,TrId+"tata");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function deleteLine(deleteLinkNode, typeStr) {
|
||||
|
||||
TrId = deleteLinkNode.id.substr(0,deleteLinkNode.id.length-10);
|
||||
clickedRowContentValue = document.getElementById(TrId+"contentValue");
|
||||
clickedRowContentValue.style.textDecoration="line-through";
|
||||
|
||||
//tinyMCE.execCommand('mceAddControl',false,TrId+'tata');
|
||||
//tinyMCE.activeEditor.setContent('', {format : 'raw'});
|
||||
//tinyMCE.execCommand('mceSetContent',false,'');
|
||||
//tinyMCE.execCommand('mceRemoveControl',false,TrId+'tata');
|
||||
|
||||
document.getElementById(TrId+'tata').innerHTML = '';
|
||||
clickedRowEditLink = document.getElementById(TrId+"editLink");
|
||||
clickedRowEditLink.style.display="none";
|
||||
clickedRowDeleteLink = document.getElementById(TrId+"deleteLink");
|
||||
clickedRowDeleteLink.style.display="none";
|
||||
clickedRowUndeleteLink = document.getElementById(TrId+"undeleteLink");
|
||||
clickedRowUndeleteLink.style.display="inline";
|
||||
|
||||
}
|
||||
|
||||
function undeleteLine(undeleteLinkNode, typeStr) {
|
||||
index = undeleteLinkNode.id.substr(0,undeleteLinkNode.id.length-12);
|
||||
theContentValue=document.getElementById(index+"contentValue");
|
||||
//theContentValueBackup=document.getElementById(index+"contentValueBackup");
|
||||
//theContentValue.innerHTML = theContentValueBackup.innerHTML;
|
||||
theContentValue.style.textDecoration="none";
|
||||
theTaTa = document.getElementById(index+"tata");
|
||||
theTaTa.innerHTML=theContentValue.innerHTML;
|
||||
clickedRowEditLink = document.getElementById(TrId+"editLink");
|
||||
clickedRowEditLink.style.display="inline";
|
||||
clickedRowDeleteLink = document.getElementById(TrId+"deleteLink");
|
||||
clickedRowDeleteLink.style.display="inline";
|
||||
clickedRowUndeleteLink = document.getElementById(TrId+"undeleteLink");
|
||||
clickedRowUndeleteLink.style.display="none";
|
||||
}
|
||||
|
||||
function convertLiToTextarea(linkNode, typeStr) {
|
||||
LiId = linkNode.id.substr(0,linkNode.id.length-8);
|
||||
theLic = document.getElementById(LiId+"content");
|
||||
theLic.style.display="none";
|
||||
theTa = document.getElementById(LiId+"ta");
|
||||
theTa.style.display="block";
|
||||
tinyMCE.execCommand('mceAddControl',false,LiId+'tata');
|
||||
return false;
|
||||
}
|
||||
|
||||
function backToLi(okLinkNode) {
|
||||
index = okLinkNode.id.substr(0,okLinkNode.id.length-6);
|
||||
textareaDivId = index+"ta";
|
||||
liDivId = index+"contentValue";
|
||||
content = tinyMCE.activeEditor.getContent();
|
||||
tinyMCE.execCommand('mceRemoveControl',false,textareaDivId+'ta');
|
||||
theTextarea = document.getElementById(textareaDivId);
|
||||
theTextarea.style.display="none";
|
||||
theLi = document.getElementById(liDivId);
|
||||
// replace this:
|
||||
theLi.innerHTML = content;
|
||||
theLi.parentNode.style.display = 'block';
|
||||
return false;
|
||||
}
|
||||
|
||||
function cancelBackToLi(cancelLinkNode) {
|
||||
index = cancelLinkNode.id.substr(0,cancelLinkNode.id.length-10);
|
||||
textareaDivId = index+"ta";
|
||||
liDivId = index+"contentValue";
|
||||
tinyMCE.execCommand('mceRemoveControl',false,textareaDivId+'ta');
|
||||
theTextarea = document.getElementById(textareaDivId);
|
||||
theTextarea.style.display="none";
|
||||
theTaTa = document.getElementById(textareaDivId+"ta");
|
||||
theLi = document.getElementById(liDivId);
|
||||
theLi.parentNode.style.display = 'block';
|
||||
theTaTa.innerHTML = theLi.innerHTML;
|
||||
// if unused new row, just hide it completely (delete?)
|
||||
if (theLi.innerHTML=="") {
|
||||
theUnusedRow = document.getElementById(index);
|
||||
theUnusedRow.style.display="none";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function submitPage() {
|
||||
theForm = document.getElementById("editForm");
|
||||
theButtonWeWantToClick = document.getElementById("primaryAction");
|
||||
theHiddenInput = document.createElement("input")
|
||||
theHiddenInput.type="hidden";
|
||||
theHiddenInput.name=theButtonWeWantToClick.name;
|
||||
theHiddenInput.value=theButtonWeWantToClick.name;
|
||||
theForm.appendChild(theHiddenInput);
|
||||
theForm.submit();
|
||||
}
|
||||
|
||||
function findPos(obj)
|
||||
{
|
||||
var curleft = curtop = 0;
|
||||
if (obj.offsetParent) {
|
||||
curleft = obj.offsetLeft
|
||||
curtop = obj.offsetTop
|
||||
while (obj = obj.offsetParent) {
|
||||
curleft += obj.offsetLeft
|
||||
curtop += obj.offsetTop
|
||||
}
|
||||
}
|
||||
return [curleft,curtop];
|
||||
}
|
||||
-->
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
// Using jQuery to step in for DWR and provide original moniker selection behavior
|
||||
// -------------------------------------------------------------------------------
|
||||
var monikerSelection = {
|
||||
// onChange event listener for moniker select list
|
||||
monikerListener: function() {
|
||||
$('#Moniker').change(function() {
|
||||
// alert('The moniker has changed');
|
||||
// if "[new moniker]" is selected, then enable the alt field
|
||||
if ( $('#Moniker option:selected').text() == "[new moniker]" ) {
|
||||
$('#MonikerSelectAlt').removeAttr('disabled');
|
||||
} else {
|
||||
$('#MonikerSelectAlt').val('');
|
||||
$('#MonikerSelectAlt').attr('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
monikerSelection.monikerListener();
|
||||
});
|
||||
</script>
|
|
@ -1,29 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var initTinyMCE = {
|
||||
// Initial page setup
|
||||
onLoad: function() {
|
||||
this.mergeFromTemplate();
|
||||
this.initObjects();
|
||||
this.initEditor();
|
||||
|
||||
},
|
||||
|
||||
// Add variables from menupage template
|
||||
mergeFromTemplate: function() {
|
||||
$.extend(this, customFormData);
|
||||
},
|
||||
initObjects: function() {
|
||||
this.wsywigFields = $(".useTinyMce");
|
||||
},
|
||||
// Create references to frequently used elements for convenience
|
||||
initEditor: function() {
|
||||
initTinyMCE.wsywigFields.tinymce(initTinyMCE.tinyMCEData);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
initTinyMCE.onLoad();
|
||||
});
|
||||
|
|
@ -1,679 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/* this code uses:
|
||||
dwrutil in util.js
|
||||
vitro.js
|
||||
detect.js
|
||||
*/
|
||||
dojo.require("dojo.io.*");
|
||||
dojo.require("dojo.event.*");
|
||||
|
||||
//DWREngine.setErrorHandler(function(data){alert("DWREngine error: " + data);});
|
||||
//DWREngine.setWarningHandler(function(data){alert("DWREngine warning: " + data);});
|
||||
|
||||
/*
|
||||
ents_edit.js has several tasks:
|
||||
1) fill up the property table with one row for each ents2ents record
|
||||
2) delete ents2ents if requested to
|
||||
3) add a form to allow a new ents2ents relations to be created
|
||||
4) bring up a form to edit an existing ents2ents
|
||||
|
||||
The html form for tasks 3 and 4 is from a div with id="propertydiv" on
|
||||
the ents_edit.JSP ( <-- notice, it's on the JSP ). See the js function
|
||||
getForm().
|
||||
|
||||
There was a problem where the DWR calls were throwing error messages
|
||||
for larger (but not unreasonably large) sets of entity data. Updating to DWR
|
||||
2.0rc2.8 did not fix this. The current solution is a servlet that
|
||||
returns a JSON string for just the entitiy list.
|
||||
|
||||
DWR is still used to get info about the entity and the list of ents2ents.
|
||||
|
||||
CHANGES
|
||||
2006-11-21 bdc34: removing the 'new entity' button, added comments
|
||||
*/
|
||||
|
||||
var gEntityUri; //used to hold the URI of the entity being edited
|
||||
var gProperty; // used to hold property on form
|
||||
var gEntity; //entity that this page is editing
|
||||
var editingNewProp = false; //true when editing a new property
|
||||
|
||||
var gVClassUri = null;
|
||||
|
||||
//hash: PropertyDWR.propertyId+"D" or "R" (for domain or range) --> obj: PropertyDWR
|
||||
var gPropertyHash;
|
||||
|
||||
//holds the xhtmlrequest so we can do an abort
|
||||
var gEntRequest = null;
|
||||
|
||||
var justwritenProp = null;
|
||||
var justwritenTr = null;
|
||||
|
||||
if( vitroJsLoaded === undefined || vitroJsLoaded === null ){
|
||||
alert("ents_edit.js needs to have the code from vitro.js loaded first");
|
||||
}
|
||||
|
||||
var rowId = 1;
|
||||
|
||||
function getNextRowId() {
|
||||
rowId++;
|
||||
return rowId;
|
||||
}
|
||||
|
||||
/** This refreshes the dynamic parts of the page.
|
||||
It is also called on page load. */
|
||||
function update( ) {
|
||||
gEntityUri = getEntityUriFromPage();
|
||||
abortExistingEntRequest();
|
||||
clearProp();
|
||||
updateTable();
|
||||
updateEntityAndPropHash();
|
||||
var but = $("newPropButton");
|
||||
if( but ) { but.disabled = false; }
|
||||
}
|
||||
|
||||
/** called when the property editing form is dismissed */
|
||||
function clearProp() {
|
||||
abortExistingEntRequest();
|
||||
var clearMap={sunrise:"",sunset: ""};
|
||||
editingNewProp = false;
|
||||
gVClassUri = null;
|
||||
DWRUtil.setValues( clearMap );
|
||||
clear($("propertyList"));
|
||||
clear($("vClassList"));
|
||||
|
||||
var ele = $("entitiesList");
|
||||
while( ele != null && ele.length > 0){
|
||||
ele.remove(0);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* This updates the gPropertyHash and gEntity.
|
||||
*****************************************************************/
|
||||
function updateEntityAndPropHash(){
|
||||
gPropertyHash = null;
|
||||
gProperty = null;
|
||||
gEntity = null;
|
||||
|
||||
/* This is the method that is called to set gEntity and then get ents2ents properties */
|
||||
var setGEntity = function(entityObj){
|
||||
gEntity=entityObj;
|
||||
//once we set the gEntity we can get the ents2ents properties.
|
||||
//PropertyDWR.getAllPropInstByVClass(setPropertyHash, entityObj.VClassURI );
|
||||
if( entityObj != null && 'URI' in entityObj )
|
||||
PropertyDWR.getAllPossiblePropInstForIndividual(setPropertyHash, entityObj.URI);
|
||||
//else
|
||||
//alert("could not find an individual, usually this means that there is no type for the URI");
|
||||
};
|
||||
|
||||
/* This is the method that builds the gPropertyHash. It is called by setGEntity() */
|
||||
var setPropertyHash = function(propArray) {
|
||||
if( propArray == null || propArray.length < 1 ) {
|
||||
gPropertyHash = null; /* propArray might be null if we have no properties in the system */
|
||||
}else{
|
||||
gPropertyHash = new Object();
|
||||
for(var i = 0; i < propArray.length; i++) {
|
||||
var hashid = propArray[i]["propertyURI"] ;
|
||||
if( propArray[i].subjectSide ){
|
||||
hashid = hashid + 'D';
|
||||
} else {
|
||||
hashid = hashid + 'R';
|
||||
}
|
||||
gPropertyHash[ hashid ] = propArray[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//get the gEntity and then build the gPropertyHash
|
||||
EntityDWR.entityByURI(setGEntity, gEntityURI);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
set up some kind of warning that there are no properties in the system
|
||||
*****************************************************************/
|
||||
function doNoPropsWarning(){
|
||||
alert(
|
||||
"There are no object properties in the system.\n\n"+
|
||||
"This is most likely because you have just finished installing. "+
|
||||
"The button you have clicked adds a new object property statement relating this individual " +
|
||||
"to another individual. If you are looking to add new object properties to the " +
|
||||
"system, look under the 'About' menu.");
|
||||
var but = $("newPropButton");
|
||||
if( but ) { but.disabled = true; }
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
because dwr calls are async we have a callback
|
||||
*****************************************************************/
|
||||
function updateTable(callback) {
|
||||
var cb = callback;
|
||||
function fillTable(props) {
|
||||
DWRUtil.removeAllRows("propbody");
|
||||
/* This makes the row that gets added to the ents_edit form for each ents2ents object. */
|
||||
addRows($("propbody"), props,
|
||||
[getDomain, getProperty, getRange, getEdit, getDelete],
|
||||
makeTr);
|
||||
var newPropTr = $("justwritenTr");
|
||||
if( newPropTr != null ){
|
||||
Fat.fade_element( "justwritenTr" );
|
||||
}
|
||||
if(cb !== undefined && cb !== null ) { cb(); }
|
||||
}
|
||||
PropertyDWR.getExistingProperties(fillTable,gEntityURI);
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* ******************** table column builders *****************************/
|
||||
/* Change these functions to change the way the html table gets built *****/
|
||||
/* in the addRows() func each of these will get called and wrapped in a <tr>
|
||||
to make the row to stick into the table */
|
||||
var getDomain = function(prop) {
|
||||
return prop.subjectName;
|
||||
};
|
||||
|
||||
var getProperty = function(prop) {
|
||||
return makePropLinkElement(prop.propertyURI, prop.domainPublic);
|
||||
};
|
||||
|
||||
var getRange = function(prop) {
|
||||
return makeEntLinkElement(prop.objectEntURI, prop.objectName);
|
||||
};
|
||||
|
||||
var getDelete = function(prop) {
|
||||
var quote = new RegExp('\'','g');
|
||||
var dquote = new RegExp('"','g');
|
||||
return '<input type="button" value="Delete" class="form-button" ' +
|
||||
'onclick="deleteProp(' +
|
||||
'\'' + cleanForString(prop.subjectEntURI) + '\', ' +
|
||||
'\'' + cleanForString(prop.propertyURI) + '\', ' +
|
||||
'\'' + cleanForString(prop.objectEntURI) + '\', ' +
|
||||
'\'' + cleanForString(prop.objectName) + '\', ' +
|
||||
'\'' + cleanForString(prop.domainPublic) + '\' )">';
|
||||
};
|
||||
|
||||
var getEdit = function(prop){
|
||||
var quote = new RegExp('\'','g');
|
||||
return '<input type="button" value="Edit" class="form-button" '+
|
||||
'onclick="editTable(this,' +
|
||||
'\''+ cleanForString(prop.subjectEntURI)+'\', ' +
|
||||
'\''+ cleanForString(prop.propertyURI) +'\', ' +
|
||||
'\''+ cleanForString(prop.objectEntURI) +'\')">';
|
||||
};
|
||||
|
||||
var quote = new RegExp('\'','g');
|
||||
var dquote = new RegExp('"','g');
|
||||
|
||||
function cleanForString(strIn){
|
||||
var strOut = strIn.replace(quote, '\\\'');
|
||||
strOut = strOut.replace(dquote, '"');
|
||||
return strOut;
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
This makeTr is a function with access to a closure that
|
||||
includes the vars previousPropName and currentClass.
|
||||
All of this work is to get the table row color to change when
|
||||
we start drawing a row for a property that is different than the
|
||||
previous row.
|
||||
*****************************************************************/
|
||||
var makeTr = (function(){ /* outer func */
|
||||
// the reason for the outer func is to capture these values in a closure
|
||||
// This allows us to have a func that has state associated with it
|
||||
var previousPropName = "-1";
|
||||
var currentClass = "form-row-even";
|
||||
|
||||
//each time makeTr() is called this is the code that gets executed.
|
||||
return (function(prop) {/* inner func */
|
||||
if( getProperty(prop) != previousPropName ){
|
||||
previousPropName = getProperty(prop);
|
||||
currentClass=(currentClass=="form-row-even"?"form-row-odd":"form-row-even");
|
||||
}
|
||||
tr = document.createElement("tr");
|
||||
//tr.id = "proprow" + prop.ents2entsId;
|
||||
tr.className = currentClass;
|
||||
if( justwritenProp != null &&
|
||||
justwritenProp.subjectEntURI == prop.subjectEntURI &&
|
||||
justwritenProp.propertyURI == prop.propertyURI &&
|
||||
justwritenProp.objectEntURI == prop.objectEntURI){
|
||||
tr.id ="justwritenTr";
|
||||
justwritenProp = null;
|
||||
}
|
||||
return tr;
|
||||
});/*close inner function*/
|
||||
} )(); /*close and call outer function to return the inner function */
|
||||
|
||||
/* **************** end table column builders **************** */
|
||||
|
||||
/****************************************************************
|
||||
******** Functions for the Property Editing Form **************
|
||||
*****************************************************************/
|
||||
|
||||
/* called when Edit button is clicked */
|
||||
function editTable(inputElement, subjectURI, predicateURI, objectURI){
|
||||
var rowIndex = inputElement.parentNode.parentNode.rowIndex-1 ;
|
||||
var table = $("propbody");
|
||||
table.deleteRow( rowIndex );
|
||||
table.insertRow(rowIndex);
|
||||
table.rows[rowIndex].insertCell(0);
|
||||
var vform = getForm();
|
||||
table.rows[rowIndex].cells[0].appendChild( vform );
|
||||
table.rows[rowIndex].cells[0].colSpan = tableMaxColspan( table );
|
||||
vform.style.display="block";
|
||||
|
||||
PropertyDWR.getProperty(fillForm, subjectURI, predicateURI, objectURI);
|
||||
inputElement.parentNode.parentNode.style.display="none";
|
||||
}
|
||||
|
||||
/** called when Delete button is clicked */
|
||||
function deleteProp( subjectURI, predicateURI, objectURI, objectName, predicateName) {
|
||||
if( PropertyDWR.deleteProp ){
|
||||
if (confirm("Are you sure you want to delete the property\n"
|
||||
+ objectName + " " + predicateName + "?")) {
|
||||
PropertyDWR.deleteProp(update, subjectURI, predicateURI, objectURI);
|
||||
}
|
||||
} else {
|
||||
alert("Deletion of object property statements is disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
adds the editing form <tr> to the propeties table
|
||||
*****************************************************************/
|
||||
function appendPropForm(tr, colspan ){
|
||||
var form = getForm();
|
||||
while(tr.cells.length > 0 ){
|
||||
tr.deleteCell(0);
|
||||
}
|
||||
var td = tr.insertCell(-1);
|
||||
td.appendChild( form );
|
||||
|
||||
if( colspan !== undefined && colspan > 0){
|
||||
td.colSpan=colspan;
|
||||
}
|
||||
form.style.display="block";
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
This gets called when the button to make a new property
|
||||
for the entity is pressed.
|
||||
*****************************************************************/
|
||||
function newProp() {
|
||||
if( gPropertyHash == null || gPropertyHash.length < 1 ) {
|
||||
/* propArray might be null if we have no properties in the system */
|
||||
doNoPropsWarning();
|
||||
}else{
|
||||
var innerNew = function (){
|
||||
var newP = {};
|
||||
newP.domainClass = gEntity.vClassId;
|
||||
newP.subjectName = gEntity.name;
|
||||
newP.subjectEntURI = gEntity.URI;
|
||||
|
||||
fillForm( newP );
|
||||
editingNewProp = true;
|
||||
fillRangeVClassList();
|
||||
var table = $("propbody");
|
||||
var tr = table.insertRow(0);
|
||||
tr.id = "newrow";
|
||||
appendPropForm( tr, tableMaxColspan( table ) );
|
||||
|
||||
//table.insertBefore(tr, table.rows[0]);
|
||||
};
|
||||
updateTable( innerNew );
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Fills out the property edit form with the given property
|
||||
*****************************************************************/
|
||||
function fillForm(aprop) {
|
||||
clearProp();
|
||||
gProperty = aprop;
|
||||
var vclass = gProperty.domainClass;
|
||||
|
||||
DWRUtil.setValues(gProperty);
|
||||
|
||||
toggleDisabled("newPropButton");
|
||||
|
||||
fillPropList(vclass); // this will also fill the vclass and ents lists
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
This will fill the select list will all of the properties found
|
||||
in the gPropertyHash and then trigger a update of the vClasList
|
||||
******************************************************************/
|
||||
function fillPropList(classId) {
|
||||
/* This function fills up the form's select list with options
|
||||
Notice that the option id is the propertyid + 'D' or 'R'
|
||||
so that domain and range properties can be distinguished */
|
||||
var propList = $("propertyList");
|
||||
clear(propList);
|
||||
|
||||
//add properties as options
|
||||
for( var i in gPropertyHash ) {
|
||||
var prop = gPropertyHash[i];
|
||||
var text = "";
|
||||
var value = prop.propertyURI;
|
||||
if(prop.subjectSide){
|
||||
text= prop.domainPublic;
|
||||
if (prop.rangeClassName != null) {
|
||||
text += " ("+prop.rangeClassName +")";
|
||||
}
|
||||
value = value + 'D';
|
||||
} else {
|
||||
text= prop.rangePublic;
|
||||
if (prop.domainClassName != null) {
|
||||
text += " ("+prop.domainClassName+")";
|
||||
}
|
||||
value = value + 'R';
|
||||
}
|
||||
var opt = new Option(text, value);
|
||||
if( gProperty.propertyURI == prop.propertyURI ){
|
||||
opt.selected = true;
|
||||
}
|
||||
propList.options[propList.options.length] = opt;
|
||||
}
|
||||
|
||||
fillRangeVClassList( null );
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Fill up the range VClass list on the property editing form.
|
||||
If propId is null then the one on the property select list will be used
|
||||
*****************************************************************/
|
||||
function fillRangeVClassList( propId ){
|
||||
//If propId is null then the one on the property select list will be used
|
||||
if( propId == null ) { propId = DWRUtil.getValue("propertyList");}
|
||||
|
||||
//clear the list and put the loading message up
|
||||
var vclassListEle = $("vClassList");
|
||||
clear(vclassListEle);
|
||||
vclassListEle.options[vclassListEle.options.length] = new Option("Loading...",-10);
|
||||
//vclassListEle.options[0].selected = true;
|
||||
//vclassListEle.options[vclassListEle.options.length] = new Option("Crapping...",-15);
|
||||
|
||||
var prop = gPropertyHash[propId];
|
||||
|
||||
VClassDWR.getVClasses(
|
||||
function(vclasses){
|
||||
addVClassOptions( vclasses );
|
||||
},
|
||||
prop.domainClassURI, prop.propertyURI, prop.subjectSide);
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Adds vClasses to the vClassList and trigger an update of
|
||||
the entitiesList.
|
||||
****************************************************************/
|
||||
function addVClassOptions( vclassArray ){
|
||||
// DWRUtil.addOptions("entitiesList",null);
|
||||
var vclassEle = $("vClassList");
|
||||
clear( vclassEle );
|
||||
vclassEle.disabled = false;
|
||||
|
||||
if( vclassArray == null || vclassArray.length < 1){
|
||||
vclassEle.disabled = true;
|
||||
entsEle = $("entitiesList");
|
||||
clear(entsEle);
|
||||
var msg="There are no entities defined yet that could fill this role";
|
||||
var opt = new Option(msg,-1);
|
||||
entsEle.options[entsEle.options.length] = opt;
|
||||
entsEle.disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
addOptions("vClassList", vclassArray,
|
||||
function(vclass){ return vclass.URI; },
|
||||
function(vclass){
|
||||
var count = "";
|
||||
if( vclass.entityCount != null &&
|
||||
vclass.entityCount >= 0){
|
||||
count = " ("+vclass.entityCount+")";
|
||||
}
|
||||
return vclass.name+count;
|
||||
});
|
||||
|
||||
//attempt to set the selected option to the current vclass
|
||||
var vclassURI = null;
|
||||
var prop = gPropertyHash[ DWRUtil.getValue("propertyList") ];
|
||||
if( gProperty.propertyURI == prop.propertyURI ){
|
||||
vclassURI = gProperty.rangeClassURI;
|
||||
|
||||
DWRUtil.setValue(vclassEle, vclassURI );
|
||||
//here we were unable to set the vclass select option to the vclassid
|
||||
//of the entity. this means that the vclass of the entity is not one that
|
||||
//is permited by the PropertyInheritance and other restrictions.
|
||||
if( DWRUtil.getValue(vclassEle) != vclassURI){
|
||||
alert("This entity's class does not match the class of this property. This is usually the "+
|
||||
"result of the class of the entity having been changed. Properties that were added when " +
|
||||
"this entity had the old class still reflect that value.\n" +
|
||||
"In general the vitro system handles this but the editing of these misaligned records "+
|
||||
"is not fully supported.\n" );
|
||||
}
|
||||
}
|
||||
fillEntsList(vclassEle );
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Fill up the entity list in a property editing form.
|
||||
The propId should have the id + 'D' or 'R' to
|
||||
indicate domain or range.
|
||||
*****************************************************************/
|
||||
function fillEntsList( vclassEle ){
|
||||
if( vclassEle == null )
|
||||
vclassEle = $("vClassList");
|
||||
var vclassUri = DWRUtil.getValue( vclassEle );
|
||||
|
||||
if( vclassUri == gVClassUri )
|
||||
return;
|
||||
else
|
||||
gVClassUri = vclassUri;
|
||||
|
||||
var entsListEle = $("entitiesList");
|
||||
clear(entsListEle);
|
||||
entityOptToSelect = null;
|
||||
|
||||
entsListEle.disabled = true;
|
||||
entsListEle.options[entsListEle.options.length] = new Option("Loading...",-12);
|
||||
entsListEle.options[entsListEle.options.length-1].selected = true;
|
||||
|
||||
if( vclassUri ){
|
||||
//Notice that this is using the edu.cornell.mannlib.vitro.JSONServlet
|
||||
var base = getURLandContext();
|
||||
//these are parameters to the dojo JSON call
|
||||
|
||||
var bindArgs = {
|
||||
url: "dataservice?getEntitiesByVClass=1&vclassURI="+encodeUrl(vclassUri),
|
||||
error: function(type, data, evt){
|
||||
if( type == null ){ type = "none" ; }
|
||||
if( data == null ){ data = "none" ; }
|
||||
if( evt == null ){ evt = "none" ; }
|
||||
alert("An error occurred while attempting to get the individuals of vclass "
|
||||
+ vclassUri + "\ntype: " + type +"\ndata: "+
|
||||
data +"\nevt: " + evt );
|
||||
},
|
||||
load: function(type, data, evt){
|
||||
//clear here since we will be using addEntOptions for multiple adds
|
||||
// var entsListEle = $("entitiesList");
|
||||
// clear(entsListEle);
|
||||
addEntOptions(data, -1);
|
||||
},
|
||||
mimetype: "text/json"
|
||||
};
|
||||
abortExistingEntRequest();
|
||||
gEntRequest = dojo.io.bind(bindArgs);
|
||||
} else {
|
||||
clear(entsListEle);
|
||||
}
|
||||
}
|
||||
|
||||
/** add entities in entArray as options elements to select element "Individual" */
|
||||
function addEntOptions( entArray ){
|
||||
var entsListEle = $("entitiesList");
|
||||
|
||||
if( entArray == null || entArray.length == 0){
|
||||
clear(entsListEle);
|
||||
return;
|
||||
}
|
||||
|
||||
var previouslySelectedEntUri = gProperty.objectEntURI;
|
||||
|
||||
//check if the last element indicates that there are more results to get
|
||||
contObj = null;
|
||||
if( entArray != null && entArray[entArray.length-1].nextUrl != null ){
|
||||
contObj = entArray.pop();
|
||||
}
|
||||
|
||||
var CUTOFF = 110; //shorten entity names longer then this value.
|
||||
var foundEntity = false;
|
||||
var text;
|
||||
var value;
|
||||
var opt;
|
||||
for (var i = 0; i < entArray.length; i++) {
|
||||
text = entArray[i].name;
|
||||
if( text.length > CUTOFF){ text = text.substr(0,CUTOFF) + "..."; }
|
||||
value = entArray[i].URI;
|
||||
opt = new Option(text, value);
|
||||
entsListEle.options[entsListEle.options.length] = opt;
|
||||
if( previouslySelectedEntUri == value ){
|
||||
entityOptToSelect = opt;
|
||||
}
|
||||
}
|
||||
|
||||
if( contObj != null ){
|
||||
entsListEle.item(0).text = entsListEle.item(0).text + ".";
|
||||
addMoreEntOptions( contObj );
|
||||
} else {
|
||||
gEntRequests = [];
|
||||
entsListEle.disabled = false;
|
||||
if( entsListEle.length > 0 && entsListEle.item(0).value == -12){
|
||||
entsListEle.remove(0);
|
||||
}
|
||||
if( entityOptToSelect != null ){
|
||||
entityOptToSelect.selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
var entityOptToSelect =null;
|
||||
|
||||
/*
|
||||
* Add more entity options to the list if there are more on the request
|
||||
*
|
||||
example of a continueObj
|
||||
{"nextUrl":"http://localhost:8080/vivo/dataService?getEntitiesByVClass=1&vclassId=318",
|
||||
"entsInVClass":2773}
|
||||
*/
|
||||
function addMoreEntOptions( continueObj ){
|
||||
if( continueObj.nextUrl != null ){
|
||||
var bindArgs = {
|
||||
url: continueObj.nextUrl,
|
||||
error: function(type, data, evt){
|
||||
if( type == null ){ type = "none" ; }
|
||||
if( data == null ){ data = "none" ; }
|
||||
if( evt == null ){ evt = "none" ; }
|
||||
alert("An error addMoreEntOptions()"+"\ntype: " + type +"\ndata: "+
|
||||
data +"\nevt: " + evt );
|
||||
},
|
||||
load: function(type, data, evt){
|
||||
addEntOptions( data );
|
||||
},
|
||||
mimetype: "text/json"
|
||||
};
|
||||
abortExistingEntRequest();
|
||||
gEntRequest = dojo.io.bind(bindArgs);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Entities are now sent back as JSON in groups of 556. This is to defend against
|
||||
odd network effects and browser flakyness. DWR was choaking on large datasets
|
||||
and isn't very flexable so I moved to JSON. That still caused problems with
|
||||
large data sets ( size > 1500 ) so I'm breaking them up.
|
||||
|
||||
The reply from the JSON servlet is a JSON array. If the last item in the
|
||||
array lacks a "id" property then it is information about additional entites.
|
||||
If the last item in the JSON array has an id then you don't have to go back
|
||||
for more results.
|
||||
|
||||
Example:
|
||||
[ ...
|
||||
{"moniker":"recent journal article", "name":"{beta}2 and {beta}4
|
||||
Subunits of BK Channels Confer Differential Sensitivity to Acute
|
||||
Modulation by Steroid Hormones.", "vClassId":318, "id":18120},
|
||||
{"resultGroup":3,"entsInVClass":2773,"nextResultGroup":4,"standardReplySize":556}
|
||||
]
|
||||
|
||||
*/
|
||||
|
||||
/****************************************************************
|
||||
Check to see if property edit form is valid
|
||||
*****************************************************************/
|
||||
function validateForm(){
|
||||
var dateEx = "\nDates should be in the format YYYY-MM-DD";
|
||||
/* used to check dates here */
|
||||
return true;
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Write or update ents2ents row.
|
||||
***************************************************************/
|
||||
function writeProp() {
|
||||
if( PropertyDWR.insertProp == null ){
|
||||
alert("Writing of properties disabled for security reasons.");
|
||||
return;
|
||||
}
|
||||
if( !validateForm() ) { return; }
|
||||
var prop = gPropertyHash[DWRUtil.getValue("propertyList")];
|
||||
var newP = {};
|
||||
var oldP = gProperty;
|
||||
newP.propertyURI = prop.propertyURI;
|
||||
|
||||
var selected = DWRUtil.getValue("entitiesList");
|
||||
newP.subjectEntURI= gEntity.URI;
|
||||
newP.objectEntURI = selected ;
|
||||
|
||||
var callback = function(result){
|
||||
editingNewProp = false;
|
||||
justwritenProp = newP;
|
||||
update(); };
|
||||
|
||||
if( editingNewProp ){
|
||||
newP.ents2entsId = -1;
|
||||
PropertyDWR.insertProp(callback, newP );
|
||||
} else {
|
||||
var afterDelete=
|
||||
function(result){
|
||||
PropertyDWR.insertProp(callback, newP);
|
||||
};
|
||||
PropertyDWR.deleteProp(afterDelete,
|
||||
gProperty.subjectEntURI,
|
||||
gProperty.propertyURI,
|
||||
gProperty.objectEntURI);
|
||||
}
|
||||
}
|
||||
|
||||
/************ Things that happen on load *****************************/
|
||||
addEvent(window, 'load', update);
|
||||
|
||||
/********************* some utilities ***********************************/
|
||||
/* this clones the property edit from a div on the ents_edit.jsp */
|
||||
function getForm(){ return $("propeditdiv").cloneNode(true); }
|
||||
|
||||
/* a function to display a lot of info about an object */
|
||||
function disy( obj, note ){ alert( (note!==null?note:"") + DWRUtil.toDescriptiveString(obj, 3));}
|
||||
|
||||
/* attempts to get the URI of the entity being edited */
|
||||
function getEntityUriFromPage(){
|
||||
return document.getElementById("entityUriForDwr").nodeValue;
|
||||
}
|
||||
|
||||
function abortExistingEntRequest(){
|
||||
if( gEntRequest != null ){
|
||||
if( gEntRequest.abort ){
|
||||
gEntRequest.abort();
|
||||
}else{
|
||||
alert("No abort function found on gEntRequest");
|
||||
}
|
||||
gEntRequest = null;
|
||||
}
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
if( vitroJsLoaded == null ){
|
||||
|
||||
alert("seminar.js needs to have the code from vitro.js loaded first");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
addEvent(window, 'load', init);
|
||||
|
||||
|
||||
|
||||
function init(){
|
||||
|
||||
// if ($('monikerSelect').options.length=1) {
|
||||
// $('monikerSelectAlt').disabled = false;
|
||||
// }else{
|
||||
// $('monikerSelectAlt').disabled = true;
|
||||
// }
|
||||
|
||||
$('monikerSelect').onchange = checkMonikers;
|
||||
|
||||
update();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function update(){ //updates moniker list when type is changed
|
||||
|
||||
DWRUtil.useLoadingMessage();
|
||||
|
||||
EntityDWR.monikers(createList, document.getElementById("field2Value").value );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createList(data) { //puts options in moniker select list
|
||||
|
||||
fillList("monikerSelect", data, getCurrentMoniker() );
|
||||
|
||||
var ele = $("monikerSelect");
|
||||
|
||||
var opt = new Option("none","");
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
var opt = new Option("[new moniker]","");
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
DWRUtil.setValue("monikerSelect",getCurrentMoniker()); // getCurrentMoniker() is defined on jsp
|
||||
|
||||
checkMonikers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkMonikers(){ //checks if monikers is on [new moniker] and enables alt field
|
||||
|
||||
var sel = $('monikerSelect');
|
||||
|
||||
if( sel.value == "" || sel.options.length <= 1){
|
||||
$('monikerSelectAlt').disabled = false;
|
||||
|
||||
}else{
|
||||
|
||||
$('monikerSelectAlt').disabled = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fillList(id, data, selectedtext) {
|
||||
|
||||
var ele = $(id);
|
||||
|
||||
if (ele == null) {
|
||||
|
||||
alert("fillList() can't find an element with id: " + id + ".");
|
||||
|
||||
throw id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ele.options.length = 0; // Empty the list
|
||||
|
||||
if (data == null) { return; }
|
||||
|
||||
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
|
||||
var text = DWRUtil.toDescriptiveString(data[i]);
|
||||
|
||||
var value = text;
|
||||
|
||||
|
||||
|
||||
var opt = new Option(text, value);
|
||||
|
||||
if (selectedtext != null && selectedtext == text){
|
||||
|
||||
opt.selected=true;
|
||||
|
||||
}
|
||||
|
||||
ele.options[ele.options.length] = opt;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
String.prototype.capitalize = function() {
|
||||
return this.substring(0,1).toUpperCase() + this.substring(1);
|
||||
};
|
||||
|
||||
String.prototype.capitalizeWords = function() {
|
||||
var words = this.split(/\s+/),
|
||||
wordCount = words.length,
|
||||
i,
|
||||
newWords = [];
|
||||
|
||||
for (i = 0; i < wordCount; i++) {
|
||||
newWords.push(words[i].capitalize());
|
||||
}
|
||||
|
||||
return newWords.join(' ');
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
// html5shiv MIT @rem remysharp.com/html5-enabling-script
|
||||
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
|
||||
/*@cc_on(function(m,c){var z="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video";function n(d){for(var a=-1;++a<o;)d.createElement(i[a])}function p(d,a){for(var e=-1,b=d.length,j,q=[];++e<b;){j=d[e];if((a=j.media||a)!="screen")q.push(p(j.imports,a),j.cssText)}return q.join("")}var g=c.createElement("div");g.innerHTML="<z>i</z>";if(g.childNodes.length!==1){var i=z.split("|"),o=i.length,s=RegExp("(^|\\s)("+z+")",
|
||||
"gi"),t=RegExp("<(/*)("+z+")","gi"),u=RegExp("(^|[^\\n]*?\\s)("+z+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),r=c.createDocumentFragment(),k=c.documentElement;g=k.firstChild;var h=c.createElement("body"),l=c.createElement("style"),f;n(c);n(r);g.insertBefore(l,
|
||||
g.firstChild);l.media="print";m.attachEvent("onbeforeprint",function(){var d=-1,a=p(c.styleSheets,"all"),e=[],b;for(f=f||c.body;(b=u.exec(a))!=null;)e.push((b[1]+b[2]+b[3]).replace(s,"$1.iepp_$2")+b[4]);for(l.styleSheet.cssText=e.join("\n");++d<o;){a=c.getElementsByTagName(i[d]);e=a.length;for(b=-1;++b<e;)if(a[b].className.indexOf("iepp_")<0)a[b].className+=" iepp_"+i[d]}r.appendChild(f);k.appendChild(h);h.className=f.className;h.innerHTML=f.innerHTML.replace(t,"<$1font")});m.attachEvent("onafterprint",
|
||||
function(){h.innerHTML="";k.removeChild(h);k.appendChild(f);l.styleSheet.cssText=""})}})(this,document);@*/
|
|
@ -1,47 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
(function($) {
|
||||
|
||||
$(window).load(function(){
|
||||
|
||||
var jcrop_api = $.Jcrop('#cropbox',{
|
||||
/*onChange: showPreview,*/
|
||||
onSelect: showPreview,
|
||||
setSelect: [ 0, 0, 115, 115 ],
|
||||
minSize: [ 115, 115 ],
|
||||
boxWidth: 650,
|
||||
aspectRatio: 1
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var bounds = jcrop_api.getBounds();
|
||||
var boundx = bounds[0];
|
||||
var boundy = bounds[1];
|
||||
|
||||
function showPreview(coords)
|
||||
{
|
||||
if (parseInt(coords.w) > 0)
|
||||
{
|
||||
var rx = 115 / coords.w;
|
||||
var ry = 115 / coords.h;
|
||||
|
||||
$('#preview').css({
|
||||
width: Math.round(rx * boundx) + 'px',
|
||||
height: Math.round(ry * boundy) + 'px',
|
||||
marginLeft: '-' + Math.round(rx * coords.x) + 'px',
|
||||
marginTop: '-' + Math.round(ry * coords.y) + 'px'
|
||||
});
|
||||
|
||||
$('input[name=x]').val(coords.x);
|
||||
$('input[name=y]').val(coords.y);
|
||||
$('input[name=w]').val(coords.w);
|
||||
$('input[name=h]').val(coords.h);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
}(jQuery));
|
|
@ -1,10 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// Confirmation alert for photo deletion in image upload and individual templates
|
||||
$('#photoUploadDefaultImage a.thumbnail, a.delete-mainImage').click(function(){
|
||||
var answer = confirm(i18n_confirmDelete);
|
||||
return answer;
|
||||
});
|
||||
});
|
|
@ -1,109 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$.extend(this, i18nStringsUriRdf);
|
||||
|
||||
// This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon.
|
||||
$('span#iconControlsLeftSide').children('img#uriIcon').each(function()
|
||||
{
|
||||
$(this).qtip(
|
||||
{
|
||||
content: {
|
||||
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
|
||||
},
|
||||
position: {
|
||||
corner: {
|
||||
target: 'bottomLeft',
|
||||
tooltip: 'topLeft'
|
||||
}
|
||||
},
|
||||
show: {
|
||||
when: {event: 'click'}
|
||||
},
|
||||
hide: {
|
||||
fixed: true, // Make it fixed so it can be hovered over and interacted with
|
||||
when: {
|
||||
target: $('a.close'),
|
||||
event: 'click'
|
||||
}
|
||||
},
|
||||
style: {
|
||||
padding: '1em',
|
||||
width: 400,
|
||||
backgroundColor: '#f1f2ee'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('span#iconControlsVitro').children('img#uriIcon').each(function()
|
||||
{
|
||||
$(this).qtip(
|
||||
{
|
||||
content: {
|
||||
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
|
||||
},
|
||||
position: {
|
||||
corner: {
|
||||
target: 'bottomLeft',
|
||||
tooltip: 'topLeft'
|
||||
}
|
||||
},
|
||||
show: {
|
||||
when: {event: 'click'}
|
||||
},
|
||||
hide: {
|
||||
fixed: true, // Make it fixed so it can be hovered over and interacted with
|
||||
when: {
|
||||
target: $('a.close'),
|
||||
event: 'click'
|
||||
}
|
||||
},
|
||||
style: {
|
||||
padding: '1em',
|
||||
width: 400,
|
||||
backgroundColor: '#f1f2ee'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('span#iconControlsRightSide').children('img#uriIcon').each(function()
|
||||
{
|
||||
$(this).qtip(
|
||||
{
|
||||
content: {
|
||||
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
|
||||
},
|
||||
position: {
|
||||
corner: {
|
||||
target: 'bottomRight',
|
||||
tooltip: 'topRight'
|
||||
}
|
||||
},
|
||||
show: {
|
||||
when: {event: 'click'}
|
||||
},
|
||||
hide: {
|
||||
fixed: true, // Make it fixed so it can be hovered over and interacted with
|
||||
when: {
|
||||
target: $('a.close'),
|
||||
event: 'click'
|
||||
}
|
||||
},
|
||||
style: {
|
||||
padding: '1em',
|
||||
width: 400,
|
||||
backgroundColor: '#f1f2ee'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Prevent close link for URI qTip from requesting bogus '#' href
|
||||
$('a.close').click(function() {
|
||||
$('#uriIcon').qtip("hide");
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -1,289 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var manageLabels = {
|
||||
|
||||
/* *** Initial page setup *** */
|
||||
|
||||
onLoad: function() {
|
||||
|
||||
this.mixIn();
|
||||
this.initObjects();
|
||||
this.initPage();
|
||||
|
||||
var selectedRadio;
|
||||
},
|
||||
|
||||
mixIn: function() {
|
||||
|
||||
// Get the custom form data from the page
|
||||
$.extend(this, customFormData);
|
||||
$.extend(this, i18nStrings);
|
||||
},
|
||||
|
||||
initObjects:function() {
|
||||
this.addLabelForm = $('#addLabelForm');
|
||||
this.showFormButtonWrapper = $('#showAddForm');
|
||||
this.showFormButton = $("#showAddFormButton");
|
||||
//button to return to profile - div with only cancel
|
||||
this.showCancelOnlyButton = $("#showCancelOnly");
|
||||
this.addLabelCancel = this.addLabelForm.find(".cancel");
|
||||
this.submit = this.addLabelForm.find('input#submit');
|
||||
this.labelLanguage = this.addLabelForm.find("#newLabelLanguage");
|
||||
this.existingLabelsList = $("#existingLabelsList");
|
||||
},
|
||||
|
||||
// Initial page setup. Called only at page load.
|
||||
initPage: function() {
|
||||
|
||||
var disableSubmit = true;
|
||||
if(this.submissionErrorsExist == "false") {
|
||||
//hide the form to add label
|
||||
this.addLabelForm.hide();
|
||||
|
||||
//If the number of available locales is zero, then hide the ability to show the form as well
|
||||
if(this.numberAvailableLocales == 0) {
|
||||
manageLabels.showFormButtonWrapper.hide();
|
||||
this.showCancelOnlyButton.show();
|
||||
} else {
|
||||
//if the add label button is visible, don't need cancel only link
|
||||
this.showCancelOnlyButton.hide();
|
||||
}
|
||||
|
||||
} else {
|
||||
//Display the form
|
||||
this.onShowAddForm();
|
||||
|
||||
//Also make sure the save button is enabled in case there is a value selected for the drop down
|
||||
if(this.labelLanguage.val() != "") {
|
||||
disableSubmit = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(disableSubmit) {
|
||||
//disable submit until user selects a language
|
||||
this.submit.attr('disabled', 'disabled');
|
||||
this.submit.addClass('disabledSubmit');
|
||||
}
|
||||
|
||||
this.bindEventListeners();
|
||||
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
|
||||
this.labelLanguage.change( function() {
|
||||
//if language selected, allow submission, otherwise disallow
|
||||
var selectedLanguage = manageLabels.labelLanguage.val();
|
||||
if(selectedLanguage != "") {
|
||||
manageLabels.submit.attr('disabled', '');
|
||||
manageLabels.submit.removeClass('disabledSubmit');
|
||||
} else {
|
||||
manageLabels.submit.attr('disabled', 'disabled');
|
||||
manageLabels.submit.addClass('disabledSubmit');
|
||||
}
|
||||
});
|
||||
|
||||
//enable form to add label to be displayed or hidden
|
||||
this.showFormButton.click(function() {
|
||||
//clear the inputs for the label if the button is being clicked
|
||||
manageLabels.clearAddForm();
|
||||
manageLabels.onShowAddForm();
|
||||
});
|
||||
|
||||
//Check for clicking on existing labels list remove links
|
||||
//Note addition will refresh the page and removing will remove the item so adding event listeners
|
||||
//to remove links should keep remove link events in synch with page
|
||||
|
||||
this.existingLabelsList.find("a.remove").click(function(event) {
|
||||
var message = "Are you sure you wish to delete this label?"
|
||||
if (!confirm(message)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//First check with confirmation whether or not they want to delete
|
||||
manageLabels.processLabelDeletion(this);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
this.addLabelForm.find("a.cancel").click(function(event){
|
||||
event.preventDefault();
|
||||
//clear the add form
|
||||
manageLabels.clearAddForm();
|
||||
//hide the add form
|
||||
manageLabels.onHideAddForm();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
clearAddForm:function() {
|
||||
//clear inputs and select
|
||||
manageLabels.addLabelForm.find("input[type='text'],select").val("");
|
||||
//set the button for save to be disabled again
|
||||
manageLabels.submit.attr('disabled', 'disabled');
|
||||
manageLabels.submit.addClass('disabledSubmit');
|
||||
},
|
||||
onShowAddForm:function() {
|
||||
manageLabels.addLabelForm.show();
|
||||
manageLabels.showFormButtonWrapper.hide();
|
||||
manageLabels.addLabelCancel.click(function(){
|
||||
//Canceling the add label form will hide the form
|
||||
manageLabels.addLabelForm.hide();
|
||||
manageLabels.showFormButtonWrapper.show();
|
||||
});
|
||||
},
|
||||
|
||||
onHideAddForm:function() {
|
||||
manageLabels.addLabelForm.hide();
|
||||
manageLabels.showFormButtonWrapper.show();
|
||||
//manageLabels.addLabelCancel.unbind("click");
|
||||
},
|
||||
//Remove label
|
||||
processLabelDeletion: function(selectedLink) {
|
||||
|
||||
// PrimitiveDelete only handles one statement, so we have to use PrimitiveRdfEdit to handle multiple
|
||||
// retractions if they exist. But PrimitiveRdfEdit also handles assertions, so pass an empty string
|
||||
// for "additions"
|
||||
var add = "";
|
||||
var labelValue = $(selectedLink).attr('labelValue');
|
||||
var tagOrTypeValue = $(selectedLink).attr('tagOrType');
|
||||
if(tagOrTypeValue == "untyped") {
|
||||
tagOrTypeValue = "";
|
||||
}
|
||||
var retract = "<" + manageLabels.individualUri + "> <http://www.w3.org/2000/01/rdf-schema#label> "
|
||||
+ "\"" + $(selectedLink).attr('labelValue') + "\"" + $(selectedLink).attr('tagOrType') + " ." ;
|
||||
|
||||
|
||||
|
||||
retract = retract.substring(0,retract.length -1);
|
||||
|
||||
$.ajax({
|
||||
url: manageLabels.processingUrl,
|
||||
type: 'POST',
|
||||
data: {
|
||||
additions: add,
|
||||
retractions: retract
|
||||
},
|
||||
dataType: 'json',
|
||||
context: selectedLink, // context for callback
|
||||
complete: function(request, status) {
|
||||
|
||||
if (status == 'success') {
|
||||
//Remove the label from the list
|
||||
manageLabels.removeLabelFromList(selectedLink);
|
||||
manageLabels.updateLocaleSelection();
|
||||
}
|
||||
else {
|
||||
//Instead of alert, write error to template
|
||||
alert(manageLabels.errorProcessingLabels);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
removeLabelFromList:function(selectedLink) {
|
||||
var languageName = $(selectedLink).attr("languageName");
|
||||
$(selectedLink).parent().remove();
|
||||
//See if there are any other remove link
|
||||
if(languageName != "untyped") {
|
||||
//find if there are any other remove links for the same language
|
||||
var allRemoveLinks = manageLabels.existingLabelsList.find("a.remove");
|
||||
var removeLinks = manageLabels.existingLabelsList.find("a.remove[languageName='" + languageName + "']");
|
||||
if(removeLinks.length == 0) {
|
||||
//if there aren't any other labels for this language, also remove the heading
|
||||
manageLabels.existingLabelsList.find("h3[languageName='" + languageName + "']").remove();
|
||||
|
||||
}
|
||||
//Check to see if there is only one label left on the page, if so remove or hide the remove link
|
||||
if(allRemoveLinks.length == 1) {
|
||||
allRemoveLinks.remove();
|
||||
//These will be removed instead of hidden because currently add will reload the page
|
||||
//whereas remove executes an ajax query and the page isn't reloaded
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
//Determine if there are new locales that can be added to the options once a delete has occurred
|
||||
updateLocaleSelection:function() {
|
||||
//Check what languages remain
|
||||
var existingLanguages = {};
|
||||
//Look at which languages are currently represented
|
||||
manageLabels.existingLabelsList.find("a.remove").each(function(){
|
||||
var languageCode = $(this).attr("languageCode");
|
||||
if(!(languageCode in existingLanguages)) {
|
||||
existingLanguages[languageCode] = true;
|
||||
}
|
||||
});
|
||||
|
||||
//Now check against full list, if any in full list not represented, will need to include in dropdown
|
||||
//This is a list of
|
||||
var availableLocalesList = [];
|
||||
var listLen = selectLocalesFullList.length;
|
||||
var i;
|
||||
for(i = 0; i < listLen; i++) {
|
||||
var possibleLanguageInfo = selectLocalesFullList[i];
|
||||
var possibleLanguageCode = possibleLanguageInfo["code"];
|
||||
var possibleLangaugeLabel = possibleLanguageInfo["label"];
|
||||
if(!(possibleLanguageCode in existingLanguages)) {
|
||||
//manageLabels.addLanguageCode(possibleLanguageCode, possibleLanguageLabel);
|
||||
availableLocalesList.push(possibleLanguageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//Now sort this list by the label property on the object
|
||||
availableLocalesList.sort(function(a, b) {
|
||||
var compA = a["label"];
|
||||
var compB = b["label"];
|
||||
return compA < compB ? -1 : 1;
|
||||
});
|
||||
//Re-show the add button and the form if they were hidden before
|
||||
if(availableLocalesList.length > 0 && manageLabels.showFormButtonWrapper.is(":hidden")) {
|
||||
manageLabels.showFormButtonWrapper.show();
|
||||
//hide the cancel only button
|
||||
manageLabels.showCancelOnlyButton.hide();
|
||||
}
|
||||
|
||||
//Now replace dropdown with this new list
|
||||
manageLabels.generateLocalesDropdown(availableLocalesList);
|
||||
|
||||
},
|
||||
generateLocalesDropdown:function(availableLocalesList) {
|
||||
//First check if there are any available locales left, if not then hide the entire add form
|
||||
//technically, this first part should never be invoked client side because
|
||||
//this can only happen on ADD not remove, and add will refresh the page
|
||||
//On the other hand the show add button etc. can be displayed
|
||||
if(availableLocalesList.length == 0) {
|
||||
//Hide the add form if there are no locales left that can be added
|
||||
manageLabels.addLabelForm.hide();
|
||||
manageLabels.showFormButtonWrapper.hide();
|
||||
} else {
|
||||
//There are some locales so generate the dropdown accordingly, removing all elements but the first
|
||||
$("#newLabelLanguage option:gt(0)").remove();
|
||||
var i;
|
||||
var len = availableLocalesList.length;
|
||||
for(i = 0; i < len; i++) {
|
||||
var localeInfo = availableLocalesList[i];
|
||||
manageLabels.addLocaleInfo(localeInfo);
|
||||
}
|
||||
//Put some value in that shows whether neither add button nor add form were shown
|
||||
//because the form thought there were no available locales
|
||||
}
|
||||
},
|
||||
|
||||
addLocaleInfo:function(localeInfo) {
|
||||
//Add code to dropdown
|
||||
//Would we need to regenerate alphabetically? Argh.
|
||||
manageLabels.labelLanguage.append("<option value='" + localeInfo["code"] + "'>" + localeInfo["label"] + "</option>");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
manageLabels.onLoad();
|
||||
});
|
|
@ -1,145 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var menuManagement = {
|
||||
|
||||
// Initial page setup
|
||||
onLoad: function() {
|
||||
this.mergeFromTemplate();
|
||||
this.initMenuItemData();
|
||||
this.initObjects();
|
||||
this.initMenuItemsDD();
|
||||
},
|
||||
|
||||
// Add variables from menupage template
|
||||
mergeFromTemplate: function() {
|
||||
$.extend(this, menuManagementData);
|
||||
$.extend(this, i18nStrings);
|
||||
},
|
||||
|
||||
// Create references to frequently used elements for convenience
|
||||
initObjects: function() {
|
||||
this.menuItemsList = $('ul.menuItems');
|
||||
},
|
||||
|
||||
// Drag-and-drop
|
||||
initMenuItemsDD: function() {
|
||||
var menuItems = this.menuItemsList.children('li');
|
||||
|
||||
if (menuItems.length < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.menuItemsList.addClass('dragNdrop');
|
||||
|
||||
menuItems.attr('title', menuManagement.dragDropMenus);
|
||||
|
||||
|
||||
|
||||
/*$("#loading").ajaxStart(function(){
|
||||
$(this).show();
|
||||
});
|
||||
$("#loading").ajaxStop(function(){
|
||||
$(this).hide();
|
||||
});*/
|
||||
|
||||
|
||||
this.menuItemsList.sortable({
|
||||
cursor: 'move',
|
||||
update: function(event, ui) {
|
||||
menuManagement.reorderMenuItems(event, ui);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// Reorder menu items. Called after menu item drag-and-drop
|
||||
reorderMenuItems: function(event, ui) {
|
||||
var menuItems = $('li.menuItem').map(function(index, el) {
|
||||
return $(this).data('menuItemUri');
|
||||
}).get();
|
||||
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: menuManagement.reorderUrl,
|
||||
data: {
|
||||
predicate: menuManagement.positionPredicate,
|
||||
individuals: menuItems
|
||||
},
|
||||
traditional: true, // serialize the array of individuals for the server
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: function(data, status, request) {
|
||||
var pos;
|
||||
$('.menuItem').each(function(index){
|
||||
pos = index + 1;
|
||||
// Set the new position for this element. The only function of this value
|
||||
// is so we can reset an element to its original position in case reordering fails.
|
||||
menuManagement.setPosition(this, pos);
|
||||
|
||||
});
|
||||
},
|
||||
error: function(request, status, error) {
|
||||
// ui is undefined after removal of a menu item.
|
||||
if (ui) {
|
||||
// Put the moved item back to its original position.
|
||||
// Seems we need to do this by hand. Can't see any way to do it with jQuery UI. ??
|
||||
var pos = menuManagement.getPosition(ui.item),
|
||||
nextpos = pos + 1,
|
||||
menuItems = menuManagement.menuItemsList,
|
||||
next = menuManagement.findMenuItem('position', nextpos);
|
||||
|
||||
if (next.length) {
|
||||
ui.item.insertBefore(next);
|
||||
}
|
||||
else {
|
||||
ui.item.appendTo(menuItems);
|
||||
}
|
||||
|
||||
alert(menuManagement.reorderingFailed);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// On page load, associate data with each menu item list element. Then we don't
|
||||
// have to keep retrieving data from or modifying the DOM as we manipulate the
|
||||
// menu items.
|
||||
initMenuItemData: function() {
|
||||
$('.menuItem').each(function(index) {
|
||||
$(this).data(menuItemData[index]);
|
||||
|
||||
// RY We might still need position to put back an element after reordering
|
||||
// failure. Position might already have been reset? Check.
|
||||
// We also may need position to implement undo links: we want the removed menu item
|
||||
// to show up in the list, but it has no position.
|
||||
$(this).data('position', index+1);
|
||||
});
|
||||
},
|
||||
|
||||
getPosition: function(menuItem) {
|
||||
return $(menuItem).data('position');
|
||||
},
|
||||
|
||||
setPosition: function(menuItem, pos) {
|
||||
$(menuItem).data('position', pos);
|
||||
},
|
||||
|
||||
findMenuItem: function(key, value) {
|
||||
var matchingMenuItem = $(); // if we don't find one, return an empty jQuery set
|
||||
|
||||
$('.menuItem').each(function() {
|
||||
var menuItem = $(this);
|
||||
if ( menuItem.data(key) === value ) {
|
||||
matchingMenuItem = menuItem;
|
||||
return false; // stop the loop
|
||||
}
|
||||
});
|
||||
|
||||
return matchingMenuItem;
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
menuManagement.onLoad();
|
||||
});
|
|
@ -1,91 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$.fn.exists = function () {
|
||||
return this.length !== 0;
|
||||
}
|
||||
|
||||
$.fn.moreLess = function () {
|
||||
$(this).each
|
||||
}
|
||||
|
||||
var togglePropDisplay = {
|
||||
showMore: function($toggleLink, $itemContainer) {
|
||||
$toggleLink.click(function() {
|
||||
$itemContainer.show();
|
||||
$(this).attr('href', '#show less content');
|
||||
$(this).text(i18nStrings.displayLess);
|
||||
togglePropDisplay.showLess($toggleLink, $itemContainer);
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
showLess: function($toggleLink, $itemContainer) {
|
||||
$toggleLink.click(function() {
|
||||
$itemContainer.hide();
|
||||
$(this).attr('href', '#show more content');
|
||||
$(this).text(i18nStrings.displayMoreEllipsis);
|
||||
togglePropDisplay.showMore($toggleLink, $itemContainer);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// var $propList = $('.property-list').not('>li>ul');
|
||||
var $propList = $('.property-list:not(:has(>li>ul))');
|
||||
$propList.each(function() {
|
||||
var limit = $(this).attr("displayLimit");
|
||||
var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')');
|
||||
if ( $additionalItems.exists() ) {
|
||||
// create container for additional elements
|
||||
var $itemContainer = $('<div class="additionalItems" />').appendTo(this);
|
||||
|
||||
// create toggle link
|
||||
var $toggleLink = $('<a class="more-less" href="#show more content" title="' + i18nStrings.showMoreContent + '">' + i18nStrings.displayMoreEllipsis + '</a>').appendTo(this);
|
||||
|
||||
$additionalItems.appendTo($itemContainer);
|
||||
|
||||
$itemContainer.hide();
|
||||
|
||||
togglePropDisplay.showMore($toggleLink, $itemContainer);
|
||||
}
|
||||
});
|
||||
|
||||
var $subPropList = $('.subclass-property-list');
|
||||
$subPropList.each(function() {
|
||||
var limit = $(this).parent().parent().attr("displayLimit");
|
||||
var $additionalItems = $(this).find('li:gt(' + (limit - 1) + ')');
|
||||
if ( $additionalItems.exists() ) {
|
||||
// create container for additional elements
|
||||
var $itemContainer = $('<div class="additionalItems" />').appendTo(this);
|
||||
|
||||
// create toggle link
|
||||
var $toggleLink = $('<a class="more-less" href="#show more content" title="' + i18nStrings.showMoreContent + '">' + i18nStrings.displayMoreEllipsis + '</a>').appendTo(this);
|
||||
|
||||
$additionalItems.appendTo($itemContainer);
|
||||
|
||||
$itemContainer.hide();
|
||||
|
||||
togglePropDisplay.showMore($toggleLink, $itemContainer);
|
||||
}
|
||||
});
|
||||
|
||||
var $subPropSibs = $subPropList.closest('li').last().nextAll();
|
||||
var $subPropParent = $subPropList.closest('li').last().parent();
|
||||
var $additionalItems = $subPropSibs.slice(3);
|
||||
if ( $additionalItems.length > 0 ) {
|
||||
// create container for additional elements
|
||||
var $itemContainer = $('<div class="additionalItems" />').appendTo($subPropParent);
|
||||
|
||||
// create toggle link
|
||||
var $toggleLink = $('<a class="more-less" href="#show more content" title="' + i18nStrings.showMoreContent + '">' + i18nStrings.displayMoreEllipsis + '</a>').appendTo($subPropParent);
|
||||
|
||||
$additionalItems.appendTo($itemContainer);
|
||||
|
||||
$itemContainer.hide();
|
||||
|
||||
togglePropDisplay.showMore($toggleLink, $itemContainer);
|
||||
}
|
||||
|
||||
});
|
|
@ -1,233 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$.extend(this, individualLocalName);
|
||||
adjustFontSize();
|
||||
padSectionBottoms();
|
||||
checkLocationHash();
|
||||
|
||||
// ensures that shorter property group sections don't cause the page to "jump around"
|
||||
// when the tabs are clicked
|
||||
function padSectionBottoms() {
|
||||
$.each($('section.property-group'), function() {
|
||||
var sectionHeight = $(this).height();
|
||||
if ( sectionHeight < 1000 ) {
|
||||
$(this).css('margin-bottom', 1000-sectionHeight + "px");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// controls the property group tabs
|
||||
$.each($('li.clickable'), function() {
|
||||
var groupName = $(this).attr("groupName");
|
||||
var $propertyGroupLi = $(this);
|
||||
|
||||
$(this).click(function() {
|
||||
|
||||
if ( $propertyGroupLi.attr("class") == "nonSelectedGroupTab clickable" ) {
|
||||
$.each($('li.selectedGroupTab'), function() {
|
||||
$(this).removeClass("selectedGroupTab clickable");
|
||||
$(this).addClass("nonSelectedGroupTab clickable");
|
||||
});
|
||||
$propertyGroupLi.removeClass("nonSelectedGroupTab clickable");
|
||||
$propertyGroupLi.addClass("selectedGroupTab clickable");
|
||||
}
|
||||
if ( $propertyGroupLi.attr("groupname") == "viewAll" ) {
|
||||
processViewAllTab();
|
||||
}
|
||||
else {
|
||||
padSectionBottoms();
|
||||
var $visibleSection = $('section.property-group:visible');
|
||||
$visibleSection.hide();
|
||||
$('h2[pgroup=tabs]').addClass("hidden");
|
||||
$('nav#scroller').addClass("hidden");
|
||||
$('section#' + groupName).show();
|
||||
}
|
||||
manageLocalStorage();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function processViewAllTab() {
|
||||
$.each($('section.property-group'), function() {
|
||||
$(this).css("margin-bottom", "1px");
|
||||
$(this).children('h2').css("margin-top", "-15px").css("border-bottom","1px solid #DFEBE5").css("padding","12px 25px 10px 20px");
|
||||
$(this).show();
|
||||
$('h2[pgroup=tabs]').removeClass("hidden");
|
||||
$('nav#scroller').removeClass("hidden");
|
||||
});
|
||||
}
|
||||
|
||||
// If users click a marker on the home page map, they are taken to the profile
|
||||
// page of the corresponding country. The url contains the word "Research" in
|
||||
// the location hash. Use this to select the Research tab, which displays the
|
||||
// researchers who have this countru as a geographic focus.
|
||||
function checkLocationHash() {
|
||||
if ( location.hash ) {
|
||||
// remove the trailing white space
|
||||
location.hash = location.hash.replace(/\s+/g, '');
|
||||
if ( location.hash.indexOf("map") >= 0 ) {
|
||||
// get the name of the group that contains the geographicFocusOf property.
|
||||
var tabName = $('h3#geographicFocusOf').parent('article').parent('div').attr("id");
|
||||
tabName = tabName.replace("Group","");
|
||||
tabNameCapped = tabName.charAt(0).toUpperCase() + tabName.slice(1);
|
||||
// if the name of the first tab section = tabName we don't have to do anything;
|
||||
// otherwise, select the correct tab and deselect the first one
|
||||
var $firstTab = $('li.clickable').first();
|
||||
if ( $firstTab.text() != tabNameCapped ) {
|
||||
// select the correct tab
|
||||
$('li[groupName="' + tabName + '"]').removeClass("nonSelectedGroupTab clickable");
|
||||
$('li[groupName="' + tabName + '"]').addClass("selectedGroupTab clickable");
|
||||
// deselect the first tab
|
||||
$firstTab.removeClass("selectedGroupTab clickable");
|
||||
$firstTab.addClass("nonSelectedGroupTab clickable");
|
||||
$('section.property-group:visible').hide();
|
||||
// show the selected tab section
|
||||
$('section#' + tabName).show();
|
||||
}
|
||||
// if there is a more link, "click" more to show all the researchers
|
||||
// we need the timeout delay so that the more link can get rendered
|
||||
setTimeout(geoFocusExpand,250);
|
||||
}
|
||||
else {
|
||||
retrieveLocalStorage();
|
||||
}
|
||||
}
|
||||
else {
|
||||
retrieveLocalStorage();
|
||||
}
|
||||
}
|
||||
|
||||
function geoFocusExpand() {
|
||||
// if the ontology is set to collate by subclass, $list.length will be > 0
|
||||
// this ensures both possibilities are covered
|
||||
var $list = $('ul#geographicFocusOfList').find('ul');
|
||||
if ( $list.length > 0 )
|
||||
{
|
||||
var $more = $list.find('a.more-less');
|
||||
$more.click();
|
||||
}
|
||||
else {
|
||||
var $more = $('ul#geographicFocusOfList').find('a.more-less');
|
||||
$more.click();
|
||||
}
|
||||
}
|
||||
|
||||
// Next two functions -- keep track of which property group tab was selected,
|
||||
// so if we return from a custom form or a related individual, even via the back button,
|
||||
// the same property group will be selected as before.
|
||||
function manageLocalStorage() {
|
||||
var localName = this.individualLocalName;
|
||||
// is this individual already stored? If not, how many have been stored?
|
||||
// If the answer is 3, remove the first one in before adding the new one
|
||||
var current = amplify.store(localName);
|
||||
var profiles = amplify.store("profiles");
|
||||
if ( current == undefined ) {
|
||||
if ( profiles == undefined ) {
|
||||
var lnArray = [];
|
||||
lnArray.push(localName);
|
||||
amplify.store("profiles", lnArray);
|
||||
}
|
||||
else if ( profiles != undefined && profiles.length >= 3 ) {
|
||||
firstItem = profiles[0];
|
||||
amplify.store(firstItem, null);
|
||||
profiles.splice(0,1);
|
||||
profiles.push(localName);
|
||||
amplify.store("profiles", profiles)
|
||||
}
|
||||
else if ( profiles != undefined && profiles.length < 3 ) {
|
||||
profiles.push(localName);
|
||||
amplify.store("profiles", profiles)
|
||||
}
|
||||
}
|
||||
var selectedTab = [];
|
||||
selectedTab.push($('li.selectedGroupTab').attr('groupName'));
|
||||
amplify.store(localName, selectedTab);
|
||||
var checkLength = amplify.store(localName);
|
||||
if ( checkLength.length == 0 ) {
|
||||
amplify.store(localName, null);
|
||||
}
|
||||
}
|
||||
|
||||
function retrieveLocalStorage() {
|
||||
|
||||
var localName = this.individualLocalName;
|
||||
var selectedTab = amplify.store(individualLocalName);
|
||||
|
||||
if ( selectedTab != undefined ) {
|
||||
var groupName = selectedTab[0];
|
||||
|
||||
// unlikely, but it's possible a tab that was previously selected and stored won't be
|
||||
// displayed because the object properties would have been deleted (in non-edit mode).
|
||||
// So ensure that the tab in local storage has been rendered on the page.
|
||||
if ( $("ul.propertyTabsList li[groupName='" + groupName + "']").length ) {
|
||||
// if the selected tab is the default first one, don't do anything
|
||||
if ( $('li.clickable').first().attr("groupName") != groupName ) {
|
||||
// deselect the default first tab
|
||||
var $firstTab = $('li.clickable').first();
|
||||
$firstTab.removeClass("selectedGroupTab clickable");
|
||||
$firstTab.addClass("nonSelectedGroupTab clickable");
|
||||
// select the stored tab
|
||||
$("li[groupName='" + groupName + "']").removeClass("nonSelectedGroupTab clickable");
|
||||
$("li[groupName='" + groupName + "']").addClass("selectedGroupTab clickable");
|
||||
// hide the first tab section
|
||||
$('section.property-group:visible').hide();
|
||||
|
||||
if ( groupName == "viewAll" ) {
|
||||
processViewAllTab();
|
||||
}
|
||||
|
||||
// show the selected tab section
|
||||
$('section#' + groupName).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if there are so many tabs that they wrap to a second line, adjust the font size to
|
||||
//prevent wrapping
|
||||
function adjustFontSize() {
|
||||
var width = 0;
|
||||
$('ul.propertyTabsList li').each(function() {
|
||||
width += $(this).outerWidth();
|
||||
});
|
||||
if ( width < 922 ) {
|
||||
var diff = 927-width;
|
||||
$('ul.propertyTabsList li:last-child').css('width', diff + 'px');
|
||||
}
|
||||
else {
|
||||
var diff = width-926;
|
||||
if ( diff < 26 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.96em");
|
||||
}
|
||||
else if ( diff > 26 && diff < 50 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.92em");
|
||||
}
|
||||
else if ( diff > 50 && diff < 80 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.9em");
|
||||
}
|
||||
else if ( diff > 80 && diff < 130 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.84em");
|
||||
}
|
||||
else if ( diff > 130 && diff < 175 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.8em");
|
||||
}
|
||||
else if ( diff > 175 && diff < 260 ) {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.73em");
|
||||
}
|
||||
else {
|
||||
$('ul.propertyTabsList li').css('font-size', "0.7em");
|
||||
}
|
||||
|
||||
// get the new width
|
||||
var newWidth = 0
|
||||
$('ul.propertyTabsList li').each(function() {
|
||||
newWidth += $(this).outerWidth();
|
||||
});
|
||||
var newDiff = 926-newWidth;
|
||||
$('ul.propertyTabsList li:last-child').css('width', newDiff + 'px');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 105 B |
Before Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 119 B |
Before Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
|
@ -1,573 +0,0 @@
|
|||
/*
|
||||
* jQuery UI CSS Framework 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*/
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
||||
.ui-helper-clearfix { display: inline-block; }
|
||||
/* required comment for clearfix to work in Opera \*/
|
||||
* html .ui-helper-clearfix { height:1%; }
|
||||
.ui-helper-clearfix { display:block; }
|
||||
/* end clearfix */
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
|
||||
/*
|
||||
* jQuery UI CSS Framework 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
||||
.ui-widget-content a { color: #222222; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-widget :active { outline: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-off { background-position: -96px -144px; }
|
||||
.ui-icon-radio-on { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
||||
.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
|
||||
* jQuery UI Resizable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Resizable#theming
|
||||
*/
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
|
||||
* jQuery UI Selectable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Selectable#theming
|
||||
*/
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
/*
|
||||
* jQuery UI Accordion 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion#theming
|
||||
*/
|
||||
/* IE/Win - Fix animation bug - #4615 */
|
||||
.ui-accordion { width: 100%; }
|
||||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
|
||||
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-content-active { display: block; }
|
||||
/*
|
||||
* jQuery UI Autocomplete 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Autocomplete#theming
|
||||
*/
|
||||
.ui-autocomplete { position: absolute; cursor: default; }
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
/*
|
||||
* jQuery UI Menu 1.8.9
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Menu#theming
|
||||
*/
|
||||
.ui-menu {
|
||||
list-style:none;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
display:block;
|
||||
float: left;
|
||||
}
|
||||
.ui-menu .ui-menu {
|
||||
margin-top: -3px;
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
margin:0;
|
||||
padding: 0;
|
||||
zoom: 1;
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-menu .ui-menu-item a {
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
padding:.2em .4em;
|
||||
line-height:1.5;
|
||||
zoom:1;
|
||||
}
|
||||
.ui-menu .ui-menu-item a.ui-state-hover,
|
||||
.ui-menu .ui-menu-item a.ui-state-active {
|
||||
font-weight: normal;
|
||||
margin: -1px;
|
||||
}
|
||||
/*
|
||||
* jQuery UI Button 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Button#theming
|
||||
*/
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
/*
|
||||
* jQuery UI Dialog 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Dialog#theming
|
||||
*/
|
||||
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
/*
|
||||
* jQuery UI Slider 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Slider#theming
|
||||
*/
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
|
||||
* jQuery UI Tabs 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs#theming
|
||||
*/
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tabs .ui-tabs-hide { display: none !important; }
|
||||
/*
|
||||
* jQuery UI Datepicker 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker#theming
|
||||
*/
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
display: none; /*sorry for IE5*/
|
||||
display/**/: block; /*sorry for IE5*/
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}/*
|
||||
* jQuery UI Progressbar 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Progressbar#theming
|
||||
*/
|
||||
.ui-progressbar { height:2em; text-align: left; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
|
@ -1,781 +0,0 @@
|
|||
/*!
|
||||
* jQuery UI 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.9",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
|
||||
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
|
||||
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
|
||||
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
|
||||
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
|
||||
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
|
||||
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
|
||||
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Widget 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
|
||||
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
|
||||
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
|
||||
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
|
||||
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
|
||||
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Mouse 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Mouse
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(true===c.data(b.target,a.widgetName+".preventClickEvent")){c.removeData(b.target,a.widgetName+".preventClickEvent");b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
|
||||
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
|
||||
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);
|
||||
return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent",
|
||||
true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Position 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Position
|
||||
*/
|
||||
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
|
||||
left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
|
||||
k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
|
||||
m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
|
||||
d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
|
||||
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
|
||||
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Draggable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Draggables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
|
||||
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
|
||||
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
|
||||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
|
||||
this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
|
||||
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
|
||||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
|
||||
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
|
||||
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
|
||||
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?
|
||||
0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
|
||||
10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==
|
||||
Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
|
||||
f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;
|
||||
if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/
|
||||
b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-
|
||||
this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=
|
||||
this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.9"});
|
||||
d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=
|
||||
0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=
|
||||
c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,
|
||||
true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=
|
||||
0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=
|
||||
a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},
|
||||
stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=
|
||||
document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-
|
||||
c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-
|
||||
(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable",
|
||||
"snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=
|
||||
c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",
|
||||
{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,
|
||||
left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,
|
||||
a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,
|
||||
b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Droppable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Droppables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.draggable.js
|
||||
*/
|
||||
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
|
||||
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
|
||||
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
|
||||
this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
|
||||
d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
|
||||
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.9"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
|
||||
switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
|
||||
i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
|
||||
"none";if(c[f].visible){c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight};e=="mousedown"&&c[f]._activate.call(c[f],b)}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
|
||||
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=
|
||||
d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})}}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Resizable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Resizables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
|
||||
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
||||
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
|
||||
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
|
||||
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
|
||||
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
|
||||
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
|
||||
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
|
||||
d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
|
||||
this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
|
||||
this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
|
||||
b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
|
||||
f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",
|
||||
b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=
|
||||
a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,
|
||||
k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),
|
||||
c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
|
||||
this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+
|
||||
a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,
|
||||
arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,
|
||||
{version:"1.8.9"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,
|
||||
function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=
|
||||
(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=
|
||||
false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-
|
||||
a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",
|
||||
b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top",
|
||||
"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,
|
||||
f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=
|
||||
a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+
|
||||
a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&
|
||||
e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",
|
||||
height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=
|
||||
d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Selectable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Selectables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
|
||||
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
|
||||
c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
|
||||
c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
|
||||
this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
|
||||
a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
|
||||
!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
|
||||
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.9"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Sortable 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Sortables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
|
||||
this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,
|
||||
arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=
|
||||
c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,
|
||||
{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();
|
||||
if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
|
||||
a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");
|
||||
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
|
||||
this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+
|
||||
b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+
|
||||
"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,
|
||||
c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==
|
||||
document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-
|
||||
1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});
|
||||
this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&
|
||||
a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?
|
||||
"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?
|
||||
c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;
|
||||
return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=
|
||||
d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});
|
||||
return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=
|
||||
d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=
|
||||
this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=
|
||||
e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];
|
||||
if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);
|
||||
c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===
|
||||
1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=
|
||||
this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):
|
||||
b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==
|
||||
""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
|
||||
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
|
||||
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions=
|
||||
{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||
|
||||
document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,
|
||||
b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=
|
||||
document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
|
||||
e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-
|
||||
this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<
|
||||
this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&
|
||||
this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=
|
||||
this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();
|
||||
this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],
|
||||
this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",
|
||||
g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||
|
||||
this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,
|
||||
originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.9"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Accordion 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
|
||||
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
||||
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
|
||||
function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+
|
||||
a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");
|
||||
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
|
||||
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
|
||||
a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
|
||||
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
|
||||
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
|
||||
if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
|
||||
e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
|
||||
e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
|
||||
tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.9",animations:{slide:function(a,b){a=
|
||||
c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);f[i]={value:j[1],
|
||||
unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide",
|
||||
paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Autocomplete 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Autocomplete
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.position.js
|
||||
*/
|
||||
(function(d){d.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){f=false;var e=d.ui.keyCode;
|
||||
switch(c.keyCode){case e.PAGE_UP:a._move("previousPage",c);break;case e.PAGE_DOWN:a._move("nextPage",c);break;case e.UP:a._move("previous",c);c.preventDefault();break;case e.DOWN:a._move("next",c);c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:if(a.menu.active){f=true;c.preventDefault()}case e.TAB:if(!a.menu.active)return;a.menu.select(c);break;case e.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=
|
||||
null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(f){f=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||
|
||||
"body",b)[0]).mousedown(function(c){var e=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(g){g.target!==a.element[0]&&g.target!==e&&!d.ui.contains(e,g.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,e){e=e.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:e})&&/^key/.test(c.originalEvent.type)&&a.element.val(e.value)},selected:function(c,e){var g=e.item.data("item.autocomplete"),
|
||||
h=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=h;setTimeout(function(){a.previous=h;a.selectedItem=g},1)}false!==a._trigger("select",c,{item:g})&&a.element.val(g.value);a.term=a.element.val();a.close(c);a.selectedItem=g},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");
|
||||
this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,f;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,e){e(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source===
|
||||
"string"){f=this.options.source;this.source=function(c,e){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:f,data:c,dataType:"json",success:function(g,h,i){i===a.xhr&&e(g);a.xhr=null},error:function(g){g===a.xhr&&e([]);a.xhr=null}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;
|
||||
this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==
|
||||
this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position))},
|
||||
_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var f=this;d.each(b,function(c,e){f._renderItem(a,e)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);
|
||||
else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var f=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return f.test(c.label||c.value||c)})}})})(jQuery);
|
||||
(function(d){d.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(d(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
|
||||
-1).mouseenter(function(b){a.activate(b,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var f=b.offset().top-this.element.offset().top,c=this.element.attr("scrollTop"),e=this.element.height();if(f<0)this.element.attr("scrollTop",c+f);else f>=e&&this.element.attr("scrollTop",c+f-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})},
|
||||
deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,f){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0);
|
||||
a.length?this.activate(f,a):this.activate(f,this.element.children(b))}else this.activate(f,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,f=this.element.height(),c=this.element.children(".ui-menu-item").filter(function(){var e=d(this).offset().top-b-f+d(this).height();return e<10&&e>-10});c.length||(c=this.element.children(".ui-menu-item:last"));this.activate(a,
|
||||
c)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,f=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-b+f-d(this).height();return c<10&&c>-10});result.length||(result=this.element.children(".ui-menu-item:first"));
|
||||
this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Button 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Button
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(a){var g,i=function(b){a(":ui-button",b.target.form).each(function(){var c=a(this).data("button");setTimeout(function(){c.refresh()},1)})},h=function(b){var c=b.name,d=b.form,e=a([]);if(c)e=d?a(d).find("[name='"+c+"']"):a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form});return e};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",
|
||||
i);if(typeof this.options.disabled!=="boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,c=this.options,d=this.type==="checkbox"||this.type==="radio",e="ui-state-hover"+(!d?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",
|
||||
function(){if(!c.disabled){a(this).addClass("ui-state-hover");this===g&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||a(this).removeClass(e)}).bind("focus.button",function(){a(this).addClass("ui-state-focus")}).bind("blur.button",function(){a(this).removeClass("ui-state-focus")});d&&this.element.bind("change.button",function(){b.refresh()});if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).toggleClass("ui-state-active");
|
||||
b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed",true);var f=b.element[0];h(f).not(f).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");
|
||||
g=this;a(document).one("mouseup",function(){g=null})}).bind("mouseup.button",function(){if(c.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(f){if(c.disabled)return false;if(f.keyCode==a.ui.keyCode.SPACE||f.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(f){f.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",
|
||||
c.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var b=this.element.is(":checked");b&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=
|
||||
this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||
|
||||
this.buttonElement.removeAttr("title");a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")h(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
|
||||
true):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
||||
c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");
|
||||
this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},
|
||||
destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Dialog 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Dialog
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.button.js
|
||||
* jquery.ui.draggable.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.position.js
|
||||
* jquery.ui.resizable.js
|
||||
*/
|
||||
(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&
|
||||
c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",
|
||||
-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role",
|
||||
"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=
|
||||
b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&
|
||||
a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index");
|
||||
isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);
|
||||
d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}});
|
||||
c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f,
|
||||
h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('<button type="button"></button>').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=
|
||||
d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,
|
||||
position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,
|
||||
h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===
|
||||
1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in
|
||||
l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");
|
||||
break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e=
|
||||
this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&&
|
||||
this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.9",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===
|
||||
0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
|
||||
height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
|
||||
b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,
|
||||
function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Slider 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Slider
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");a.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
|
||||
this.range=d([]);if(a.range){if(a.range===true){this.range=d("<div></div>");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
|
||||
if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length<a.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();
|
||||
else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=
|
||||
false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===
|
||||
b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
|
||||
this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b,
|
||||
g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},
|
||||
_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;
|
||||
if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=
|
||||
this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c<e))c=e;if(c!==this.values(a)){e=this.values();e[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:e});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],
|
||||
value:c});b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
|
||||
this._trimAlignValue(b);this._refreshValue();this._change(null,0)}return this._value()},values:function(b,a){var c,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):this.value();
|
||||
else return this._values()},_setOption:function(b,a){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
|
||||
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
|
||||
return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
|
||||
_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate);
|
||||
if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
|
||||
1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.9"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Tabs 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
|
||||
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
|
||||
d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
|
||||
(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
|
||||
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
|
||||
this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
|
||||
if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
|
||||
this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
|
||||
g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
|
||||
function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
|
||||
this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
|
||||
-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
|
||||
d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
|
||||
d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
|
||||
e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
|
||||
j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
|
||||
if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
|
||||
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
|
||||
load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
|
||||
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
|
||||
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.9"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
|
||||
a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Datepicker 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
*/
|
||||
(function(d,G){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
||||
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
||||
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
|
||||
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]==
|
||||
null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.9"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();
|
||||
f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
|
||||
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
|
||||
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
|
||||
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
|
||||
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
|
||||
true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});
|
||||
b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);
|
||||
this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",
|
||||
this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,
|
||||
function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:
|
||||
f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},
|
||||
e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);
|
||||
this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]?
|
||||
d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||
|
||||
a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,
|
||||
e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,
|
||||
"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},
|
||||
_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=
|
||||
d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,
|
||||
c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&
|
||||
d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",
|
||||
function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=
|
||||
-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,
|
||||
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},
|
||||
_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-
|
||||
g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?
|
||||
b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
|
||||
_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
|
||||
0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=
|
||||
false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=
|
||||
d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);
|
||||
else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=
|
||||
a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
|
||||
g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){var v=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&v?4:p=="o"?3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,v,H){p=o(p)?H:v;for(v=0;v<p.length;v++)if(b.substr(s,p[v].length).toLowerCase()==p[v].toLowerCase()){s+=p[v].length;return v+1}throw"Unknown name at position "+
|
||||
s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(k)if(a.charAt(z)=="'"&&!o("'"))k=false;else r();else switch(a.charAt(z)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var w=new Date(m("@"));c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case "!":w=new Date((m("!")-this._ticksTo1970)/1E4);c=w.getFullYear();j=w.getMonth()+
|
||||
1;l=w.getDate();break;case "'":if(o("'"))r();else k=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",
|
||||
RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&
|
||||
a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",
|
||||
b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
|
||||
"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
|
||||
f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
|
||||
(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
|
||||
l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
|
||||
a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
|
||||
b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
|
||||
this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
||||
(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
||||
(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,
|
||||
"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=
|
||||
this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var M="",D=0;D<i[1];D++){var N=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-
|
||||
1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=
|
||||
(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=
|
||||
p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&q<k||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==N.getTime()&&g==a.selectedMonth&&a._keyEvent||L.getTime()==q.getTime()&&L.getTime()==N.getTime()?" "+this._dayOverClass:"")+(J?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!v?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":
|
||||
""))+'"'+((!B||v)&&F[2]?' title="'+F[2]+'"':"")+(J?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!v?" ":J?'<span class="ui-state-default">'+q.getDate()+"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==u.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=
|
||||
P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',
|
||||
o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&
|
||||
l)?" ":""));a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+
|
||||
a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";if(d.browser.mozilla)k+='<select class="ui-datepicker-year"><option value="'+c+'" selected="selected">'+c+"</option></select>";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=
|
||||
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
|
||||
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
|
||||
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
|
||||
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
|
||||
function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));
|
||||
return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.9";window["DP_jQuery_"+y]=d})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Progressbar 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Progressbar
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
|
||||
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
|
||||
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.9"})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/
|
||||
*/
|
||||
jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
|
||||
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
||||
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
|
||||
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
|
||||
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
|
||||
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
|
||||
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
|
||||
d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0];
|
||||
h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,
|
||||
a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.9",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,
|
||||
a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",
|
||||
border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);
|
||||
return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments);
|
||||
else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),
|
||||
b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,
|
||||
a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,
|
||||
a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==
|
||||
e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=
|
||||
g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
|
||||
h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,
|
||||
a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Blind 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Blind
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
|
||||
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Bounce 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Bounce
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
|
||||
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
|
||||
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Clip 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Clip
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
|
||||
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Drop 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Drop
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
|
||||
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Explode 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Explode
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
|
||||
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
|
||||
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Fade 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Fade
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Fold 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Fold
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
|
||||
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Highlight 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Highlight
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
|
||||
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Pulsate 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Pulsate
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
||||
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Scale 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Scale
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
|
||||
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
|
||||
1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
|
||||
p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
|
||||
if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
|
||||
a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
|
||||
child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
|
||||
n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Shake 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Shake
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
|
||||
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Slide 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Slide
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
|
||||
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Effects Transfer 1.8.9
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Effects/Transfer
|
||||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/
|
||||
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
|
||||
b.dequeue()})})}})(jQuery);
|
||||
;
|
|
@ -1,26 +0,0 @@
|
|||
// Textarea and select clone() bug workaround | Spencer Tipping
|
||||
// Licensed under the terms of the MIT source code license
|
||||
|
||||
// Motivation.
|
||||
// jQuery's clone() method works in most cases, but it fails to copy the value of textareas and select elements. This patch replaces jQuery's clone() method with a wrapper that fills in the
|
||||
// values after the fact.
|
||||
|
||||
// An interesting error case submitted by Piotr Przybył: If two <select> options had the same value, the clone() method would select the wrong one in the cloned box. The fix, suggested by Piotr
|
||||
// and implemented here, is to use the selectedIndex property on the <select> box itself rather than relying on jQuery's value-based val().
|
||||
|
||||
(function (original) {
|
||||
jQuery.fn.clone = function () {
|
||||
var result = original.apply(this, arguments),
|
||||
my_textareas = this.find('textarea').add(this.filter('textarea')),
|
||||
result_textareas = result.find('textarea').add(this.filter('textarea')),
|
||||
my_selects = this.find('select').add(this.filter('select')),
|
||||
result_selects = result.find('select').add(this.filter('select'));
|
||||
|
||||
for (var i = 0, l = my_textareas.length; i < l; ++i) $(result_textareas[i]).val($(my_textareas[i]).val());
|
||||
for (var i = 0, l = my_selects.length; i < l; ++i) result_selects[i].selectedIndex = my_selects[i].selectedIndex;
|
||||
|
||||
return result;
|
||||
};
|
||||
}) (jQuery.fn.clone);
|
||||
|
||||
// Generated by SDoc
|
16
webapp/web/js/jquery.js
vendored
|
@ -1,41 +0,0 @@
|
|||
/**
|
||||
* Isotope v1.0.110328
|
||||
* An exquisite jQuery plugin for magical layouts
|
||||
* http://isotope.metafizzy.co
|
||||
*
|
||||
* Commercial use requires one-time license fee
|
||||
* http://metafizzy.co/#licenses
|
||||
*
|
||||
* Copyright 2011 David DeSandro / Metafizzy
|
||||
*/
|
||||
(function(l,f,s){var m=function(){var a=["Moz","Webkit","Khtml","O","Ms"],b={};return function(c,d){d=d||document.documentElement;var e=d.style,g,h,i,t;if(arguments.length===1&&typeof b[c]==="string")return b[c];if(typeof e[c]==="string")return b[c]=c;h=c.charAt(0).toUpperCase()+c.slice(1);i=0;for(t=a.length;i<t;i++){g=a[i]+h;if(typeof e[g]==="string")return b[c]=g}}}(),u=document.documentElement,w=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),o=[{name:"csstransforms",getResult:function(){return!!m("transform")}},
|
||||
{name:"csstransforms3d",getResult:function(){var a=!!m("perspective");if(a){var b=document.createElement("style"),c=document.createElement("div");a="@media ("+w.join("transform-3d),(")+"modernizr)";b.textContent=a+"{#modernizr{height:3px}}";(document.head||document.getElementsByTagName("head")[0]).appendChild(b);c.id="modernizr";u.appendChild(c);a=c.offsetHeight===3;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}return!!a}},{name:"csstransitions",getResult:function(){return!!m("transitionProperty")}}],
|
||||
j,v=o.length;if(l.Modernizr)for(j=0;j<v;j++){var p=o[j];Modernizr.hasOwnProperty(p.name)||Modernizr.addTest(p.name,p.getResult)}else l.Modernizr=function(){var a={_version:"1.6ish: miniModernizr for Isotope"},b=[],c,d;for(j=0;j<v;j++){c=o[j];d=c.getResult();a[c.name]=d;c=(d?"":"no-")+c.name;b.push(c)}u.className+=" "+b.join(" ");return a}();var k={transformProp:m("transform"),fnUtils:Modernizr.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+
|
||||
a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},set:function(a,b,c){var d=f(a),e=d.data("isoTransform")||{},g={},h,i={};g[b]=c;f.extend(e,g);for(h in e)i[h]=(0,k.fnUtils[h])(e[h]);b=(i.translate||"")+(i.scale||"");d.data("isoTransform",e);a.style[k.transformProp]=b}};f.cssNumber.scale=true;f.cssHooks.scale={set:function(a,b){if(typeof b==="string")b=parseFloat(b);k.set(a,"scale",b)},get:function(a){return(a=f.data(a,"transform"))&&
|
||||
a.scale?a.scale:1}};f.fx.step.scale=function(a){f.cssHooks.scale.set(a.elem,a.now+a.unit)};f.cssNumber.translate=true;f.cssHooks.translate={set:function(a,b){k.set(a,"translate",b)},get:function(a){return(a=f.data(a,"transform"))&&a.translate?a.translate:[0,0]}};var q=f.event,r;q.special.smartresize={setup:function(){f(this).bind("resize",q.special.smartresize.handler)},teardown:function(){f(this).unbind("resize",q.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type=
|
||||
"smartresize";r&&clearTimeout(r);r=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}};f.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])};f.Isotope=function(a,b){this.element=f(b);this._create(a);this._init()};var n=["overflow","position","width","height"];f.Isotope.prototype={options:{resizable:true,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:Modernizr.csstransforms&&
|
||||
!f.browser.opera?{opacity:0,scale:0.0010}:{opacity:0},visibleStyle:Modernizr.csstransforms&&!f.browser.opera?{opacity:1,scale:1}:{opacity:1},animationEngine:f.browser.opera?"jquery":"best-available",animationOptions:{queue:false,duration:800},sortBy:"original-order",sortAscending:true,resizesContainer:true,transformsEnabled:true},_filterFind:function(a,b){return b?a.filter(b).add(a.find(b)):a},_create:function(a){this.options=f.extend(true,{},this.options,a);this.isNew={};this.styleQueue=[];this.elemCount=
|
||||
0;this.$allAtoms=this._filterFind(this.element.children(),this.options.itemSelector);a=this.element[0].style;this.originalStyle={};for(var b=0,c=n.length;b<c;b++){var d=n[b];this.originalStyle[d]=a[d]||null}this.element.css({overflow:"hidden",position:"relative"});a=false;switch(this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,"")){case "css":case "none":this.applyStyleFnName="css";break;case "jquery":this.applyStyleFnName="animate";a=true;break;default:this.applyStyleFnName=Modernizr.csstransitions?
|
||||
"css":"animate"}this.getPositionStyles=(this.usingTransforms=this.options.transformsEnabled&&Modernizr.csstransforms&&Modernizr.csstransitions&&!a)?this._translate:this._positionAbs;this.options.getSortData=f.extend(this.options.getSortData,{"original-order":function(g,h){return h.elemCount}});this._setupAtoms(this.$allAtoms);a=f(document.createElement("div"));this.element.prepend(a);this.posTop=Math.round(a.position().top);this.posLeft=Math.round(a.position().left);a.remove();var e=this;setTimeout(function(){e.element.addClass(e.options.containerClass)},
|
||||
0);this.options.resizable&&f(l).bind("smartresize.isotope",function(){e.element.isotope("resize")})},_isNewProp:function(a){return this.prevOpts?this.options[a]!==this.prevOpts[a]:true},_init:function(a){var b=this;f.each(["filter","sortBy","sortAscending"],function(c,d){b.isNew[d]=b._isNewProp(d)});this.$filteredAtoms=this.isNew.filter?this._filter(this.$allAtoms):this.$allAtoms;if(this.isNew.filter||this.isNew.sortBy||this.isNew.sortAscending)this._sort();this.reLayout(a)},option:function(a,b){if(f.isPlainObject(a))this.options=
|
||||
f.extend(true,this.options,a);else if(a&&typeof b==="undefined")return this.options[a];else this.options[a]=b;return this},_setupAtoms:function(a){var b={position:"absolute"};if(this.usingTransforms){b.left=0;b.top=0}a.css(b).addClass(this.options.itemClass);this.updateSortData(a,true)},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(b){var c=this.options.hiddenClass,d="."+c,e=a.not(d),g=a.filter(d);d=g;a=a.filter(b);if(b!=="*"){d=g.filter(b);b=e.not(b).toggleClass(c);
|
||||
b.addClass(c);this.styleQueue.push({$el:b,style:this.options.hiddenStyle})}this.styleQueue.push({$el:d,style:this.options.visibleStyle});d.removeClass(c)}return a},updateSortData:function(a,b){var c=this,d=this.options.getSortData,e,g;a.each(function(){e=f(this);g={};for(var h in d)g[h]=d[h](e,c);e.data("isotope-sort-data",g);b&&c.elemCount++})},_sort:function(){var a=this,b=function(d){return f(d).data("isotope-sort-data")[a.options.sortBy]},c=this.options.sortAscending?1:-1;this.$filteredAtoms.sort(function(d,
|
||||
e){var g=b(d),h=b(e);return(g>h?1:g<h?-1:0)*c});return this},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:b})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);this.options.resizesContainer&&this.styleQueue.push({$el:this.element,style:this["_"+c+"GetContainerSize"]()});var d=this.applyStyleFnName==="animate"&&!this.isLaidOut?
|
||||
"css":this.applyStyleFnName,e=this.options.animationOptions;f.each(this.styleQueue,function(g,h){h.$el[d](h.style,e)});this.styleQueue=[];b&&b.call(a);this.isLaidOut=true;return this},resize:function(){return this["_"+this.options.layoutMode+"Resize"]()},reLayout:function(a){return this.$allAtoms.length&&this.$filteredAtoms.length?this["_"+this.options.layoutMode+"Reset"]().layout(this.$filteredAtoms,a):this},addItems:function(a,b){var c=this._filterFind(a,this.options.itemSelector);this._setupAtoms(c);
|
||||
this.$allAtoms=this.$allAtoms.add(c);b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(d){d=c._filter(d);c.$filteredAtoms=c.$filteredAtoms.add(d)});this._sort().reLayout(b)},appended:function(a,b){var c=this;this.addItems(a,function(d){c.$filteredAtoms=c.$filteredAtoms.add(d);c.layout(d,b)})},remove:function(a){this.$allAtoms=this.$allAtoms.not(a);this.$filteredAtoms=this.$filteredAtoms.not(a);a.remove()},_shuffleArray:function(a){var b,c,d=a.length;if(d)for(;--d;){c=
|
||||
~~(Math.random()*(d+1));b=a[c];a[c]=a[d];a[d]=b}return a},shuffle:function(a){this.options.sortBy="shuffle";this.$allAtoms=this._shuffleArray(this.$allAtoms);this.$filteredAtoms=this._filter(this.$allAtoms);return this.reLayout(a)},destroy:function(){var a=this.usingTransforms;this.$allAtoms.removeClass(this.options.hiddenClass+" "+this.options.itemClass).each(function(){this.style.position=null;this.style.top=null;this.style.left=null;this.style.opacity=null;if(a)this.style[k.transformProp]=null});
|
||||
for(var b=this.element[0].style,c=0,d=n.length;c<d;c++){var e=n[c];b[e]=this.originalStyle[e]}this.element.unbind(".isotope").removeClass(this.options.containerClass).removeData("isotope");f(l).unbind(".isotope")},_getSegments:function(a,b){var c=b?"rowHeight":"columnWidth",d=b?"height":"width",e=b?"rows":"cols";this[a][c]=this.options[a]&&this.options[a][c]||this.$allAtoms["outer"+(b?"Height":"Width")](true);if(!this[a][c]){f.error(c+" calculated to be zero. Stopping Isotope plugin before divide by zero. Check that the width of first child inside the isotope container is not zero.");
|
||||
return this}this[d]=this.element[d]();this[a][e]=Math.max(Math.floor(this[d]/this[a][c]),1);return this},_masonryPlaceBrick:function(a,b,c){b=Math.min.apply(Math,c);for(var d=b+a.outerHeight(true),e=c.length,g=e,h=this.masonry.cols+1-e;e--;)if(c[e]===b)g=e;this._pushPosition(a,this.masonry.columnWidth*g+this.posLeft,b);for(e=0;e<h;e++)this.masonry.colYs[g+e]=d},_masonryLayout:function(a){var b=this;a.each(function(){var c=f(this),d=Math.ceil(c.outerWidth(true)/b.masonry.columnWidth);d=Math.min(d,
|
||||
b.masonry.cols);if(d===1)b._masonryPlaceBrick(c,b.masonry.cols,b.masonry.colYs);else{var e=b.masonry.cols+1-d,g=[],h,i;for(i=0;i<e;i++){h=b.masonry.colYs.slice(i,i+d);g[i]=Math.max.apply(Math,h)}b._masonryPlaceBrick(c,e,g)}});return this},_masonryReset:function(){this.masonry={};this._getSegments("masonry");var a=this.masonry.cols;for(this.masonry.colYs=[];a--;)this.masonry.colYs.push(this.posTop);return this},_masonryResize:function(){var a=this.masonry.cols;this._getSegments("masonry");this.masonry.cols!==
|
||||
a&&this.reLayout();return this},_masonryGetContainerSize:function(){return{height:Math.max.apply(Math,this.masonry.colYs)-this.posTop}},_fitRowsLayout:function(a){this.width=this.element.width();var b=this;a.each(function(){var c=f(this),d=c.outerWidth(true),e=c.outerHeight(true);if(b.fitRows.x!==0&&d+b.fitRows.x>b.width){b.fitRows.x=0;b.fitRows.y=b.fitRows.height}b._pushPosition(c,b.fitRows.x+b.posLeft,b.fitRows.y+b.posTop);b.fitRows.height=Math.max(b.fitRows.y+e,b.fitRows.height);b.fitRows.x+=d});
|
||||
return this},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0};return this},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResize:function(){return this.reLayout()},_cellsByRowReset:function(){this.cellsByRow={};this._getSegments("cellsByRow");this.cellsByRow.rowHeight=this.options.cellsByRow.rowHeight||this.$allAtoms.outerHeight(true);return this},_cellsByRowLayout:function(a){var b=this,c=this.cellsByRow.cols;this.cellsByRow.atomsLen=a.length;a.each(function(d){var e=
|
||||
f(this),g=(d%c+0.5)*b.cellsByRow.columnWidth-e.outerWidth(true)/2+b.posLeft;d=(~~(d/c)+0.5)*b.cellsByRow.rowHeight-e.outerHeight(true)/2+b.posTop;b._pushPosition(e,g,d)});return this},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.cellsByRow.atomsLen/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.posTop}},_cellsByRowResize:function(){var a=this.cellsByRow.cols;this._getSegments("cellsByRow");this.cellsByRow.cols!==a&&this.reLayout();return this},_straightDownReset:function(){this.straightDown=
|
||||
{y:0};return this},_straightDownLayout:function(a){var b=this;a.each(function(){var c=f(this);b._pushPosition(c,b.posLeft,b.straightDown.y+b.posTop);b.straightDown.y+=c.outerHeight(true)});return this},_straightDownGetContainerSize:function(){return{height:this.straightDown.y+this.posTop}},_straightDownResize:function(){this.reLayout();return this},_masonryHorizontalPlaceBrick:function(a,b,c){b=Math.min.apply(Math,c);for(var d=b+a.outerWidth(true),e=c.length,g=e,h=this.masonryHorizontal.rows+1-e;e--;)if(c[e]===
|
||||
b)g=e;this._pushPosition(a,b,this.masonryHorizontal.rowHeight*g+this.posTop);for(e=0;e<h;e++)this.masonryHorizontal.rowXs[g+e]=d},_masonryHorizontalLayout:function(a){var b=this;a.each(function(){var c=f(this),d=Math.ceil(c.outerHeight(true)/b.masonryHorizontal.rowHeight);d=Math.min(d,b.masonryHorizontal.rows);if(d===1)b._masonryHorizontalPlaceBrick(c,b.masonryHorizontal.rows,b.masonryHorizontal.rowXs);else{var e=b.masonryHorizontal.rows+1-d,g=[],h,i;for(i=0;i<e;i++){h=b.masonryHorizontal.rowXs.slice(i,
|
||||
i+d);g[i]=Math.max.apply(Math,h)}b._masonryHorizontalPlaceBrick(c,e,g)}});return this},_masonryHorizontalReset:function(){this.masonryHorizontal={};this._getSegments("masonryHorizontal",true);var a=this.masonryHorizontal.rows;for(this.masonryHorizontal.rowXs=[];a--;)this.masonryHorizontal.rowXs.push(this.posLeft);return this},_masonryHorizontalResize:function(){var a=this.masonryHorizontal.rows;this._getSegments("masonryHorizontal",true);this.masonryHorizontal.rows!==a&&this.reLayout();return this},
|
||||
_masonryHorizontalGetContainerSize:function(){return{width:Math.max.apply(Math,this.masonryHorizontal.rowXs)-this.posLeft}},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0};return this},_fitColumnsLayout:function(a){var b=this;this.height=this.element.height();a.each(function(){var c=f(this),d=c.outerWidth(true),e=c.outerHeight(true);if(b.fitColumns.y!==0&&e+b.fitColumns.y>b.height){b.fitColumns.x=b.fitColumns.width;b.fitColumns.y=0}b._pushPosition(c,b.fitColumns.x+b.posLeft,b.fitColumns.y+
|
||||
b.posTop);b.fitColumns.width=Math.max(b.fitColumns.x+d,b.fitColumns.width);b.fitColumns.y+=e});return this},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResize:function(){return this.reLayout()},_cellsByColumnReset:function(){this.cellsByColumn={};this._getSegments("cellsByColumn",true);this.cellsByColumn.columnWidth=this.options.cellsByColumn.columnWidth||this.$allAtoms.outerHeight(true);return this},_cellsByColumnLayout:function(a){var b=this,c=this.cellsByColumn.rows;
|
||||
this.cellsByColumn.atomsLen=a.length;a.each(function(d){var e=f(this),g=(~~(d/c)+0.5)*b.cellsByColumn.columnWidth-e.outerWidth(true)/2+b.posLeft;d=(d%c+0.5)*b.cellsByColumn.rowHeight-e.outerHeight(true)/2+b.posTop;b._pushPosition(e,g,d)});return this},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.cellsByColumn.atomsLen/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth+this.posLeft}},_cellsByColumnResize:function(){var a=this.cellsByColumn.rows;this._getSegments("cellsByColumn",
|
||||
true);this.cellsByColumn.rows!==a&&this.reLayout();return this}};f.fn.imagesLoaded=function(a){var b=this.find("img"),c=b.length,d=this;b.length||a.call(this);b.bind("load",function(){--c<=0&&a.call(d)}).each(function(){if(this.complete||this.complete===s){var e=this.src;this.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";this.src=e}});return this};f.widget=f.widget||{};f.widget.bridge=f.widget.bridge||function(a,b){f.fn[a]=function(c){var d=typeof c==="string",e=Array.prototype.slice.call(arguments,
|
||||
1),g=this;c=!d&&e.length?f.extend.apply(null,[true,c].concat(e)):c;if(d&&c.charAt(0)==="_")return g;d?this.each(function(){var h=f.data(this,a);if(!h)return f.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+c+"'");if(!f.isFunction(h[c]))return f.error("no such method '"+c+"' for "+a+" widget instance");var i=h[c].apply(h,e);if(i!==h&&i!==s){g=i;return false}}):this.each(function(){var h=f.data(this,a);h?h.option(c||{})._init():f.data(this,a,new b(c,this))});
|
||||
return g}};f.widget.bridge("isotope",f.Isotope)})(window,jQuery);
|
Before Width: | Height: | Size: 329 B |
|
@ -1,40 +0,0 @@
|
|||
/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */
|
||||
.jcrop-holder { text-align: left; }
|
||||
|
||||
.jcrop-vline, .jcrop-hline
|
||||
{
|
||||
font-size: 0;
|
||||
position: absolute;
|
||||
background: white url('Jcrop.gif') top left repeat;
|
||||
}
|
||||
.jcrop-vline { height: 100%; width: 1px !important; }
|
||||
.jcrop-hline { width: 100%; height: 1px !important; }
|
||||
.jcrop-handle {
|
||||
font-size: 1px;
|
||||
width: 7px !important;
|
||||
height: 7px !important;
|
||||
border: 1px #eee solid;
|
||||
background-color: #333;
|
||||
*width: 9px;
|
||||
*height: 9px;
|
||||
}
|
||||
|
||||
.jcrop-tracker { width: 100%; height: 100%; }
|
||||
|
||||
.custom .jcrop-vline,
|
||||
.custom .jcrop-hline
|
||||
{
|
||||
background: yellow;
|
||||
}
|
||||
.custom .jcrop-handle
|
||||
{
|
||||
border-color: black;
|
||||
background-color: #C7BB00;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
.ac_results {
|
||||
padding: 0px;
|
||||
border: 1px solid black;
|
||||
background-color: white;
|
||||
overflow: hidden;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.ac_results ul {
|
||||
width: 100%;
|
||||
list-style-position: outside;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ac_results li {
|
||||
margin: 0px;
|
||||
padding: 2px 5px;
|
||||
cursor: default;
|
||||
display: block;
|
||||
/*
|
||||
if width will be 100% horizontal scrollbar will apear
|
||||
when scroll mode will be used
|
||||
*/
|
||||
/*width: 100%;*/
|
||||
font: menu;
|
||||
font-size: 12px;
|
||||
/*
|
||||
it is very important, if line-height not setted or setted
|
||||
in relative units scroll will be broken in firefox
|
||||
*/
|
||||
line-height: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ac_loading {
|
||||
background: white url('indicator.gif') right center no-repeat;
|
||||
}
|
||||
|
||||
.ac_odd {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.ac_over {
|
||||
background-color: #0A246A;
|
||||
color: white;
|
||||
}
|
|
@ -1,501 +0,0 @@
|
|||
/*
|
||||
### jQuery Multiple File Upload Plugin v1.28 - 2008-05-02 ###
|
||||
By Diego A., http://www.fyneworks.com, diego@fyneworks.com
|
||||
|
||||
Project: http://jquery.com/plugins/project/MultiFile/
|
||||
Website: http://www.fyneworks.com/jquery/multiple-file-upload/
|
||||
Forums: http://www.nabble.com/jQuery-Multiple-File-Upload-f20931.html
|
||||
*/
|
||||
/*
|
||||
CHANGE LOG:
|
||||
12-April-2007: v1.1
|
||||
Added events and file extension validation
|
||||
See website for details.
|
||||
|
||||
06-June-2007: v1.2
|
||||
Now works in Opera.
|
||||
|
||||
12-June-2007: v1.21
|
||||
Preserves name of file input so all current server-side
|
||||
functions don't need to be changed on new installations.
|
||||
|
||||
24-June-2007: v1.22
|
||||
Now works perfectly in Opera, thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
|
||||
|
||||
10-Jan-2008: v1.24
|
||||
Fixed bug in event trigger - sending incorrect parameters to event handlers
|
||||
|
||||
14-Jan-2008: v1.24
|
||||
Fixed bug 1251: http://plugins.jquery.com/project/comments/add/1251
|
||||
|
||||
25-Jan-2008: v1.24
|
||||
Implemented feature request: http://plugins.jquery.com/node/1363
|
||||
The plugin now automatically intercepts ajaxSubmit function (form plugin)
|
||||
and disbales empty file input elements for submission
|
||||
|
||||
08-Feb-2008: v1.25
|
||||
Fixed bug: http://plugins.jquery.com/node/1495
|
||||
The last change caused the plugin to disabled input files that shouldn't have been ignored
|
||||
Now, every newly created input file (by this plugin) is marked by the MultiFile class.
|
||||
|
||||
11-Feb-2008: v1.25
|
||||
Fixed bug: http://plugins.jquery.com/node/1495
|
||||
Plugin would override element ID everytime.
|
||||
|
||||
11-Feb-2008: v1.26
|
||||
Modified plugin structure. After selecting and removing a file, the plugin would
|
||||
remove the original element from DOM. Now the plugin works back on its own tracks
|
||||
and removes the last generated element.
|
||||
This will resolve compatibility issues with validation plugins and custom code.
|
||||
|
||||
12-Feb-2008: v1.26
|
||||
Try to clear elements using the browser's native behaviour: .reset()
|
||||
This works around security policies in IE6 and Opera.
|
||||
|
||||
17-Mar-2008: v1.27
|
||||
Added properties/methods for easier form integration
|
||||
$.MultiFile.autoIntercept - array of known jQuery plugins to intercept (default: 'submit', 'ajaxSubmit', 'validate');
|
||||
$.MultiFile.intercept - intercepts a jQuery plugin / anonymous function
|
||||
$.MultiFile.disableEmpty - disable empty inputs (required for some upload scripts)
|
||||
$.MultiFile.reEnableEmpty - re-enables empty inputs
|
||||
|
||||
17-Mar-2008: v1.28
|
||||
MAJOR FIX - OPERA BUG
|
||||
MASTER.labels was a readyonly property and cause the script to fail.
|
||||
Renamed to MASTER.eLBL. Problem solved!
|
||||
|
||||
29-Apr-2008: v1.28
|
||||
Added validation to stop duplicate selections
|
||||
Extracted default configuration to $.MultiFile.options
|
||||
Improved code organization / performance
|
||||
Default name is now files[] - square brackets indicate an array is being submitted
|
||||
Added namePattern options - allows user to configure name of slave elements
|
||||
- $name = master name, $id = master id, $g = group count, $i = slave count
|
||||
- eg.: $name$i will result in file1, file2, file3 and so on...
|
||||
*/
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
;if(jQuery) (function($){
|
||||
/*# AVOID COLLISIONS #*/
|
||||
|
||||
// extend jQuery - $.MultiFile hook
|
||||
$.extend($, {
|
||||
MultiFile: function( o /* Object */ ){
|
||||
//return $("INPUT[@type='file'].multi").MultiFile(o);
|
||||
return $("input:file.multi").MultiFile(o);
|
||||
}
|
||||
});
|
||||
|
||||
//===
|
||||
|
||||
// extend $.MultiFile - default options
|
||||
$.extend($.MultiFile, {
|
||||
options: {
|
||||
accept: '', max: -1,
|
||||
// error handling function
|
||||
error: function(s){
|
||||
if($.blockUI){
|
||||
$.blockUI({
|
||||
message: s.replace(/\n/gi,'<br/>'),
|
||||
css: {
|
||||
border:'none', padding:'15px', size:'12.0pt',
|
||||
backgroundColor:'#900', color:'#fff',
|
||||
opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
|
||||
}
|
||||
});
|
||||
window.setTimeout($.unblockUI, 2000);
|
||||
}
|
||||
else{
|
||||
alert(s);
|
||||
}
|
||||
},
|
||||
// namePattern: $name/$id (from master element), $i (slave count), $g (group count)
|
||||
namePattern: '$name',
|
||||
// STRING: collection lets you show messages in different languages
|
||||
STRING: {
|
||||
remove:'remove',
|
||||
denied:'You cannot select a $ext file.\nTry again...',
|
||||
selected:'File selected: $file',
|
||||
duplicate:'This file has already been selected:\n$file'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//===
|
||||
|
||||
// extend $.MultiFile - global methods
|
||||
$.extend($.MultiFile, {
|
||||
disableEmpty: function(){
|
||||
$('input:file'/*.multi'*/).each(function(){
|
||||
var $this = $(this);
|
||||
if($this.val()=='') $this.addClass('mfD').each(function(){ this.disabled = true });
|
||||
});
|
||||
},
|
||||
reEnableEmpty: function(){
|
||||
$('input:file.mfD').removeClass('mfD').each(function(){ this.disabled = false });
|
||||
},
|
||||
autoIntercept: [ 'submit', 'ajaxSubmit', 'validate' /* array of methods to intercept */ ],
|
||||
intercepted: {},
|
||||
intercept: function(methods, context, args){
|
||||
var method, value; args = args || [];
|
||||
if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
|
||||
if(typeof(methods)=='function'){
|
||||
$.MultiFile.disableEmpty();
|
||||
value = methods.apply(context || window, args);
|
||||
$.MultiFile.reEnableEmpty();
|
||||
return value;
|
||||
};
|
||||
if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
|
||||
for(var i=0;i<methods.length;i++){
|
||||
method = methods[i]+''; // make sure that we have a STRING
|
||||
if(method) (function(method){ // make sure that method is ISOLATED for the interception
|
||||
$.MultiFile.intercepted[method] = $.fn[method] || function(){};
|
||||
$.fn[method] = function(){
|
||||
$.MultiFile.disableEmpty();
|
||||
//if(console) console.log(['$.MultiFile.intercepted', method, this, arguments]);
|
||||
value = $.MultiFile.intercepted[method].apply(this, arguments);
|
||||
$.MultiFile.reEnableEmpty();
|
||||
return value;
|
||||
}; // interception
|
||||
})(method); // MAKE SURE THAT method IS ISOLATED for the interception
|
||||
};// for each method
|
||||
}
|
||||
});
|
||||
|
||||
//===
|
||||
|
||||
// extend jQuery function library
|
||||
$.extend($.fn, {
|
||||
|
||||
// Use this function to clear values of file inputs
|
||||
// This doesn't always work: $(element).val('').attr('value', '')[0].value = '';
|
||||
reset: function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); },
|
||||
|
||||
// MultiFile function
|
||||
MultiFile: function( o /* Object */ ){
|
||||
|
||||
//### http://plugins.jquery.com/node/1363
|
||||
// utility method to integrate this plugin with others...
|
||||
if($.MultiFile.autoIntercept){
|
||||
$.MultiFile.intercept( $.MultiFile.autoIntercept /* array of methods to intercept */ );
|
||||
$.MultiFile.autoIntercept = null; /* only run this once */
|
||||
};
|
||||
|
||||
//===
|
||||
|
||||
// Bind to each element in current jQuery object
|
||||
return $(this).each(function(group_count){
|
||||
if(this._MultiFile) return; this._MultiFile = true;
|
||||
|
||||
// BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
|
||||
// variable group_count would repeat itself on multiple calls to the plugin.
|
||||
// this would cause a conflict with multiple elements
|
||||
// changes scope of variable to global so id will be unique over n calls
|
||||
window.MultiFile = (window.MultiFile || 0) + 1;
|
||||
group_count = window.MultiFile;
|
||||
|
||||
// Copy parent attributes - Thanks to Jonas Wagner
|
||||
// we will use this one to create new input elements
|
||||
var MASTER = this, xCLONE = $(MASTER).clone();
|
||||
|
||||
//===
|
||||
|
||||
//# USE CONFIGURATION
|
||||
if(typeof o=='number') o = {max:o};
|
||||
if(typeof o=='string') o = {accept:o};
|
||||
o = $.extend({},
|
||||
$.MultiFile.options,
|
||||
($.metadata ? $(MASTER).metadata()/*NEW metadata plugin*/ :
|
||||
($.meta ? $(MASTER).data()/*OLD metadata plugin*/ :
|
||||
null/*metadata plugin not available*/)) || {},
|
||||
o || {}
|
||||
);
|
||||
// limit number of files that can be selected?
|
||||
if(!(o.max>0) /*IsNull(MASTER.max)*/){
|
||||
o.max = $(MASTER).attr('maxlength');
|
||||
if(!(o.max>0) /*IsNull(MASTER.max)*/){
|
||||
o.max = (String(MASTER.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
|
||||
if(!(o.max>0)) o.max = -1;
|
||||
else o.max = String(o.max).match(/[0-9]+/gi)[0];
|
||||
}
|
||||
};
|
||||
o.max = new Number(o.max);
|
||||
// limit extensions?
|
||||
o.accept = o.accept || $(MASTER).attr('accept') || '';
|
||||
if(!o.accept){
|
||||
o.accept = (MASTER.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
|
||||
o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
|
||||
};
|
||||
|
||||
//===
|
||||
|
||||
// APPLY CONFIGURATION
|
||||
$.extend(MASTER, o || {});
|
||||
MASTER.STRING = $.extend({},$.MultiFile.options.STRING,MASTER.STRING);
|
||||
|
||||
//===
|
||||
|
||||
//#########################################
|
||||
// PRIVATE PROPERTIES/METHODS
|
||||
$.extend(MASTER, {
|
||||
n: 0, // How many elements are currently selected?
|
||||
slaves: [], files: [],
|
||||
instanceKey: MASTER.id || 'MultiFile'+String(group_count), // Instance Key?
|
||||
generateID: function(z){ return MASTER.instanceKey + (z>0 ?'_F'+String(z):''); },
|
||||
trigger: function(event, element){
|
||||
var handler = MASTER[event], value = $(element).attr('value');
|
||||
if(handler){
|
||||
var returnValue = handler(element, value, MASTER);
|
||||
if( returnValue!=null ) return returnValue;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//===
|
||||
|
||||
// Setup dynamic regular expression for extension validation
|
||||
// - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
|
||||
if(String(MASTER.accept).length>1){
|
||||
MASTER.rxAccept = new RegExp('\\.('+(MASTER.accept?MASTER.accept:'')+')$','gi');
|
||||
};
|
||||
|
||||
//===
|
||||
|
||||
// Create wrapper to hold our file list
|
||||
MASTER.wrapID = MASTER.instanceKey+'_wrap'; // Wrapper ID?
|
||||
$(MASTER).wrap('<div id="'+MASTER.wrapID+'"></div>');
|
||||
MASTER.eWRP = $('#'+MASTER.wrapID+'');
|
||||
|
||||
//===
|
||||
|
||||
// MASTER MUST have a name
|
||||
MASTER.name = MASTER.name || 'file[]';
|
||||
|
||||
//===
|
||||
|
||||
// Create a wrapper for the labels
|
||||
// * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('labels' is a read-only property)
|
||||
// this changes allows us to keep the files in the order they were selected
|
||||
MASTER.eWRP.append( '<span id="'+MASTER.wrapID+'_labels"></span>' );
|
||||
MASTER.eLBL = $('#'+MASTER.wrapID+'_labels');
|
||||
|
||||
//===
|
||||
|
||||
// Bind a new element
|
||||
MASTER.addSlave = function( slave, slave_count ){
|
||||
// Keep track of how many elements have been displayed
|
||||
MASTER.n++;
|
||||
// Add reference to master element
|
||||
slave.MASTER = MASTER;
|
||||
// Count slaves
|
||||
slave.i = slave_count;
|
||||
|
||||
// BUG FIX: http://plugins.jquery.com/node/1495
|
||||
// Clear identifying properties from clones
|
||||
if(slave.i>0) slave.id = slave.name = null;
|
||||
|
||||
// Define element's ID and name (upload components need this!)
|
||||
slave.id = slave.id || MASTER.generateID(slave.i);
|
||||
|
||||
//slave.name = (slave.name || $(MASTER).attr('name') || 'file');// + (slave.i>0?slave.i:''); // same name as master element
|
||||
// 2008-Apr-29: New customizable naming convention (see url below)
|
||||
// http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
|
||||
slave.name = String(MASTER.namePattern
|
||||
/*master name*/.replace(/\$name/gi,$(MASTER).attr('name'))
|
||||
/*master id */.replace(/\$id/gi, $(MASTER).attr('id'))
|
||||
/*group count*/.replace(/\$g/gi, (group_count>0?group_count:''))
|
||||
/*slave count*/.replace(/\$i/gi, (slave_count>0?slave_count:''))
|
||||
);
|
||||
|
||||
// Clear value
|
||||
$(slave).val('').attr('value','')[0].value = '';
|
||||
|
||||
// If we've reached maximum number, disable input slave
|
||||
if( (MASTER.max > 0) && ((MASTER.n-1) > (MASTER.max)) )//{ // MASTER.n Starts at 1, so subtract 1 to find true count
|
||||
slave.disabled = true;
|
||||
//};
|
||||
|
||||
// Remember most recent slave
|
||||
MASTER.eCur = MASTER.slaves[slave.i] = slave;
|
||||
|
||||
/// now let's use jQuery
|
||||
slave = $(slave);
|
||||
|
||||
// Triggered when a file is selected
|
||||
$(slave).change(function(){
|
||||
|
||||
//# Trigger Event! onFileSelect
|
||||
if(!MASTER.trigger('onFileSelect', this, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
//# Retrive value of selected file from element
|
||||
var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
|
||||
|
||||
// check extension
|
||||
if(MASTER.accept){
|
||||
if(v!=''){
|
||||
if(!v.match(MASTER.rxAccept)){
|
||||
ERROR = MASTER.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Disallow duplicates
|
||||
for(var f=0;f<MASTER.slaves.length;f++){
|
||||
if(MASTER.slaves[f]!=this){
|
||||
if(MASTER.slaves[f].value==v){
|
||||
ERROR = MASTER.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Create a new file input element
|
||||
//var newEle = $('<input name="'+($(MASTER).attr('name') || '')+'" type="file"/>');
|
||||
var newEle = xCLONE.clone();// Copy parent attributes - Thanks to Jonas Wagner
|
||||
//# Let's remember which input we've generated so
|
||||
// we can disable the empty ones before submission
|
||||
// See: http://plugins.jquery.com/node/1495
|
||||
newEle.addClass('MultiFile');
|
||||
|
||||
// Handle error
|
||||
if(ERROR!=''){
|
||||
// Handle error
|
||||
MASTER.error(ERROR);
|
||||
|
||||
// Clear element value (DOES NOT WORK in some browsers)
|
||||
//slave.reset().val('').attr('value', '')[0].value = '';
|
||||
|
||||
// 2007-06-24: BUG FIX - Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
|
||||
// Ditch the trouble maker and add a fresh new element
|
||||
MASTER.n--;
|
||||
MASTER.addSlave(newEle[0], this.i);
|
||||
slave.parent().prepend(newEle);
|
||||
slave.remove();
|
||||
return false;
|
||||
};
|
||||
|
||||
// Hide this element (NB: display:none is evil!)
|
||||
$(this).css({ position:'absolute', top: '-3000px' });
|
||||
|
||||
// Add new element to the form
|
||||
MASTER.eLBL.before(newEle);//.append(newEle);
|
||||
|
||||
// Update list
|
||||
MASTER.addToList( this );
|
||||
|
||||
// Bind functionality
|
||||
MASTER.addSlave( newEle[0], this.i+1 );
|
||||
|
||||
//# Trigger Event! afterFileSelect
|
||||
if(!MASTER.trigger('afterFileSelect', this, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
}); // slave.change()
|
||||
|
||||
};// MASTER.addSlave
|
||||
// Bind a new element
|
||||
|
||||
|
||||
|
||||
// Add a new file to the list
|
||||
MASTER.addToList = function( slave ){
|
||||
|
||||
//# Trigger Event! onFileAppend
|
||||
if(!MASTER.trigger('onFileAppend', slave, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
// Create label elements
|
||||
var
|
||||
r = $('<div></div>'),
|
||||
v = String(slave.value || ''/*.attr('value)*/),
|
||||
a = $('<span class="file" title="'+MASTER.STRING.selected.replace('$file', v)+'">'+v.match(/[^\/\\]+$/gi)[0]+'</span>'),
|
||||
b = $('<a href="#'+MASTER.wrapID+'">'+MASTER.STRING.remove+'</a>');
|
||||
|
||||
// Insert label
|
||||
MASTER.eLBL.append(
|
||||
r.append('[', b, '] ', a)//.prepend(slave.i+': ')
|
||||
);
|
||||
|
||||
b.click(function(){
|
||||
|
||||
//# Trigger Event! onFileRemove
|
||||
if(!MASTER.trigger('onFileRemove', slave, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
MASTER.n--;
|
||||
MASTER.eCur.disabled = false;
|
||||
|
||||
// Remove element, remove label, point to current
|
||||
if(slave.i==0){
|
||||
$(MASTER.eCur).remove();
|
||||
MASTER.eCur = slave;
|
||||
}
|
||||
else{
|
||||
$(slave).remove();
|
||||
};
|
||||
$(this).parent().remove();
|
||||
|
||||
// Show most current element again (move into view) and clear selection
|
||||
$(MASTER.eCur).css({ position:'', top: '' }).reset().val('').attr('value', '')[0].value = '';
|
||||
|
||||
//# Trigger Event! afterFileRemove
|
||||
if(!MASTER.trigger('afterFileRemove', slave, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
//# Trigger Event! afterFileAppend
|
||||
if(!MASTER.trigger('afterFileAppend', slave, MASTER)) return false;
|
||||
//# End Event!
|
||||
|
||||
}; // MASTER.addToList
|
||||
// Add element to selected files list
|
||||
|
||||
|
||||
|
||||
// Bind functionality to the first element
|
||||
if(!MASTER.MASTER) MASTER.addSlave(MASTER, 0);
|
||||
|
||||
// Increment control count
|
||||
//MASTER.I++; // using window.MultiFile
|
||||
MASTER.n++;
|
||||
|
||||
});
|
||||
// each element
|
||||
|
||||
}
|
||||
// MultiFile function
|
||||
|
||||
});
|
||||
// extend jQuery function library
|
||||
|
||||
|
||||
|
||||
/*
|
||||
### Default implementation ###
|
||||
The plugin will attach itself to file inputs
|
||||
with the class 'multi' when the page loads
|
||||
|
||||
Use the jQuery start plugin to
|
||||
*/
|
||||
/*
|
||||
if($.start){ $.start('MultiFile', $.MultiFile) }
|
||||
else $(function(){ $.MultiFile() });
|
||||
*/
|
||||
if($.start)
|
||||
$.start('MultiFile', function(context){ context = context || this; // attach to start-up
|
||||
$("INPUT[@type='file'].multi", context).MultiFile();
|
||||
});
|
||||
// $.start
|
||||
else
|
||||
$(function(){ $.MultiFile() });
|
||||
// $()
|
||||
|
||||
|
||||
|
||||
/*# AVOID COLLISIONS #*/
|
||||
})(jQuery);
|
||||
/*# AVOID COLLISIONS #*/
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
### jQuery Multiple File Upload Plugin v1.28 - 2008-05-02 ###
|
||||
By Diego A., http://www.fyneworks.com, diego@fyneworks.com
|
||||
|
||||
Project: http://jquery.com/plugins/project/MultiFile/
|
||||
Website: http://www.fyneworks.com/jquery/multiple-file-upload/
|
||||
Forums: http://www.nabble.com/jQuery-Multiple-File-Upload-f20931.html
|
||||
*/
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';2(1n)(3($){$.y($,{5:3(o){7 $("17:m.1s").5(o)}});$.y($.5,{X:{k:\'\',h:-1,1I:3(s){2($.1A){$.1A({2s:s.u(/\\n/l,\'<27/>\'),11:{Z:\'23\',1Z:\'1T\',1Q:\'12.1K\',2K:\'#2G\',2A:\'#2x\',2w:\'.8\',\'-2r-Z-1v\':\'1u\',\'-2h-Z-1v\':\'1u\'}});J.2b($.29,28)}T{26(s)}},1m:\'$D\',A:{E:\'E\',1j:\'20 1X 1W a $W m.\\1P 1N...\',M:\'1L M: $m\',1d:\'1J m 2J 2I 2F M:\\n$m\'}}});$.y($.5,{1b:3(){$(\'17:m\').H(3(){t a=$(6);2(a.1c()==\'\')a.1C(\'16\').H(3(){6.S=R})})},15:3(){$(\'17:m.16\').2p(\'16\').H(3(){6.S=q})},L:[\'2m\',\'2j\',\'2g\'],19:{},1t:3(b,c,d){t e,j;d=d||[];2(d.1r.1q().1p("1o")<0)d=[d];2(13(b)==\'3\'){$.5.1b();j=b.1l(c||J,d);$.5.15();7 j};2(b.1r.1q().1p("1o")<0)b=[b];1k(t i=0;i<b.10;i++){e=b[i]+\'\';2(e)(3(a){$.5.19[a]=$.Y[a]||3(){};$.Y[a]=3(){$.5.1b();j=$.5.19[a].1l(6,25);$.5.15();7 j}})(e)}}});$.y($.Y,{1a:3(){7 6.H(3(){24{6.1a()}22(e){}})},5:3(o){2($.5.L){$.5.1t($.5.L);$.5.L=N};7 $(6).H(3(e){2(6.1i)7;6.1i=R;J.5=(J.5||0)+1;e=J.5;t g=6,1h=$(g).1g();2(13 o==\'1V\')o={h:o};2(13 o==\'1U\')o={k:o};o=$.y({},$.5.X,($.1e?$(g).1e():($.1S?$(g).1R():N))||{},o||{});2(!(o.h>0)){o.h=$(g).C(\'1O\');2(!(o.h>0)){o.h=(p(g.1f.x(/\\b(h|1M)\\-([0-9]+)\\b/l)||[\'\']).x(/[0-9]+/l)||[\'\'])[0];2(!(o.h>0))o.h=-1;T o.h=p(o.h).x(/[0-9]+/l)[0]}};o.h=V 1Y(o.h);o.k=o.k||$(g).C(\'k\')||\'\';2(!o.k){o.k=(g.1f.x(/\\b(k\\-[\\w\\|]+)\\b/l))||\'\';o.k=V p(o.k).u(/^(k|W)\\-/i,\'\')};$.y(g,o||{});g.A=$.y({},$.5.X.A,g.A);$.y(g,{n:0,K:[],21:[],U:g.B||\'5\'+p(e),1H:3(z){7 g.U+(z>0?\'2H\'+p(z):\'\')},F:3(a,b){t c=g[a],j=$(b).C(\'j\');2(c){t d=c(b,j,g);2(d!=N)7 d}7 R}});2(p(g.k).10>1){g.1G=V 2D(\'\\\\.(\'+(g.k?g.k:\'\')+\')$\',\'l\')};g.G=g.U+\'2z\';$(g).2y(\'<O B="\'+g.G+\'"></O>\');g.1E=$(\'#\'+g.G+\'\');g.D=g.D||\'m[]\';g.1E.18(\'<P B="\'+g.G+\'1D"></P>\');g.14=$(\'#\'+g.G+\'1D\');g.Q=3(c,d){g.n++;c.1B=g;c.i=d;2(c.i>0)c.B=c.D=N;c.B=c.B||g.1H(c.i);c.D=p(g.1m.u(/\\$D/l,$(g).C(\'D\')).u(/\\$B/l,$(g).C(\'B\')).u(/\\$g/l,(e>0?e:\'\')).u(/\\$i/l,(d>0?d:\'\')));$(c).1c(\'\').C(\'j\',\'\')[0].j=\'\';2((g.h>0)&&((g.n-1)>(g.h)))c.S=R;g.I=g.K[c.i]=c;c=$(c);$(c).2v(3(){2(!g.F(\'2u\',6,g))7 q;t a=\'\',v=p(6.j||\'\');2(g.k){2(v!=\'\'){2(!v.x(g.1G)){a=g.A.1j.u(\'$W\',p(v.x(/\\.\\w{1,4}$/l)))}}};1k(t f=0;f<g.K.10;f++){2(g.K[f]!=6){2(g.K[f].j==v){a=g.A.1d.u(\'$m\',v.x(/[^\\/\\\\]+$/l))}}};t b=1h.1g();b.1C(\'5\');2(a!=\'\'){g.1I(a);g.n--;g.Q(b[0],6.i);c.1x().2q(b);c.E();7 q};$(6).11({1w:\'2t\',1y:\'-2o\'});g.14.2n(b);g.1z(6);g.Q(b[0],6.i+1);2(!g.F(\'2l\',6,g))7 q})};g.1z=3(c){2(!g.F(\'2k\',c,g))7 q;t r=$(\'<O></O>\'),v=p(c.j||\'\'),a=$(\'<P 2i="m" 2B="\'+g.A.M.u(\'$m\',v)+\'">\'+v.x(/[^\\/\\\\]+$/l)[0]+\'</P>\'),b=$(\'<a 2C="#\'+g.G+\'">\'+g.A.E+\'</a>\');g.14.18(r.18(\'[\',b,\']&2f;\',a));b.2E(3(){2(!g.F(\'2e\',c,g))7 q;g.n--;g.I.S=q;2(c.i==0){$(g.I).E();g.I=c}T{$(c).E()};$(6).1x().E();$(g.I).11({1w:\'\',1y:\'\'}).1a().1c(\'\').C(\'j\',\'\')[0].j=\'\';2(!g.F(\'2d\',c,g))7 q;7 q});2(!g.F(\'2c\',c,g))7 q};2(!g.1B)g.Q(g,0);g.n++})}});2($.1F)$.1F(\'5\',3(a){a=a||6;$("2a[@2L=\'m\'].1s",a).5()});T $(3(){$.5()})})(1n);',62,172,'||if|function||MultiFile|this|return||||||||||max||value|accept|gi|file|||String|false|||var|replace|||match|extend||STRING|id|attr|name|remove|trigger|wrapID|each|eCur|window|slaves|autoIntercept|selected|null|div|span|addSlave|true|disabled|else|instanceKey|new|ext|options|fn|border|length|css||typeof|eLBL|reEnableEmpty|mfD|input|append|intercepted|reset|disableEmpty|val|duplicate|metadata|className|clone|xCLONE|_MultiFile|denied|for|apply|namePattern|jQuery|Array|indexOf|toString|constructor|multi|intercept|10px|radius|position|parent|top|addToList|blockUI|MASTER|addClass|_labels|eWRP|start|rxAccept|generateID|error|This|0pt|File|limit|again|maxlength|nTry|size|data|meta|15px|string|number|select|cannot|Number|padding|You|files|catch|none|try|arguments|alert|br|2000|unblockUI|INPUT|setTimeout|afterFileAppend|afterFileRemove|onFileRemove|nbsp|validate|moz|class|ajaxSubmit|onFileAppend|afterFileSelect|submit|before|3000px|removeClass|prepend|webkit|message|absolute|onFileSelect|change|opacity|fff|wrap|_wrap|color|title|href|RegExp|click|been|900|_F|already|has|backgroundColor|type'.split('|'),0,{}))
|
|
@ -1,10 +0,0 @@
|
|||
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
|
||||
* $Rev: 2446 $
|
||||
*
|
||||
* Version 2.1.1
|
||||
*/
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))
|
|
@ -1,183 +0,0 @@
|
|||
/* http://keith-wood.name/realPerson.html
|
||||
Real Person Form Submission for jQuery v1.0.1.
|
||||
Written by Keith Wood (kwood{at}iinet.com.au) June 2009.
|
||||
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
||||
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
||||
Please attribute the author if you use it. */
|
||||
|
||||
(function($) { // Hide scope, no $ conflict
|
||||
|
||||
var PROP_NAME = 'realPerson';
|
||||
|
||||
/* Real person manager. */
|
||||
function RealPerson() {
|
||||
this._defaults = {
|
||||
length: 6, // Number of characters to use
|
||||
includeNumbers: false, // True to use numbers as well as letters
|
||||
regenerate: 'Click to change', // Instruction text to regenerate
|
||||
hashName: '{n}Hash' // Name of the hash value field to compare with,
|
||||
// use {n} to substitute with the original field name
|
||||
};
|
||||
}
|
||||
|
||||
var CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
var DOTS = [
|
||||
[' * ', ' * * ', ' * * ', ' * * ', ' ***** ', '* *', '* *'],
|
||||
['****** ', '* *', '* *', '****** ', '* *', '* *', '****** '],
|
||||
[' ***** ', '* *', '* ', '* ', '* ', '* *', ' ***** '],
|
||||
['****** ', '* *', '* *', '* *', '* *', '* *', '****** '],
|
||||
['*******', '* ', '* ', '**** ', '* ', '* ', '*******'],
|
||||
['*******', '* ', '* ', '**** ', '* ', '* ', '* '],
|
||||
[' ***** ', '* *', '* ', '* ', '* ***', '* *', ' ***** '],
|
||||
['* *', '* *', '* *', '*******', '* *', '* *', '* *'],
|
||||
['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'],
|
||||
[' *', ' *', ' *', ' *', ' *', '* *', ' ***** '],
|
||||
['* *', '* ** ', '* ** ', '** ', '* ** ', '* ** ', '* *'],
|
||||
['* ', '* ', '* ', '* ', '* ', '* ', '*******'],
|
||||
['* *', '** **', '* * * *', '* * *', '* *', '* *', '* *'],
|
||||
['* *', '** *', '* * *', '* * *', '* * *', '* **', '* *'],
|
||||
[' ***** ', '* *', '* *', '* *', '* *', '* *', ' ***** '],
|
||||
['****** ', '* *', '* *', '****** ', '* ', '* ', '* '],
|
||||
[' ***** ', '* *', '* *', '* *', '* * *', '* * ', ' **** *'],
|
||||
['****** ', '* *', '* *', '****** ', '* * ', '* * ', '* *'],
|
||||
[' ***** ', '* *', '* ', ' ***** ', ' *', '* *', ' ***** '],
|
||||
['*******', ' * ', ' * ', ' * ', ' * ', ' * ', ' * '],
|
||||
['* *', '* *', '* *', '* *', '* *', '* *', ' ***** '],
|
||||
['* *', '* *', ' * * ', ' * * ', ' * * ', ' * * ', ' * '],
|
||||
['* *', '* *', '* *', '* * *', '* * * *', '** **', '* *'],
|
||||
['* *', ' * * ', ' * * ', ' * ', ' * * ', ' * * ', '* *'],
|
||||
['* *', ' * * ', ' * * ', ' * ', ' * ', ' * ', ' * '],
|
||||
['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'],
|
||||
[' *** ', ' * * ', '* *', '* *', '* *', ' * * ', ' *** '],
|
||||
[' * ', ' ** ', ' * * ', ' * ', ' * ', ' * ', '*******'],
|
||||
[' ***** ', '* *', ' *', ' * ', ' ** ', ' ** ', '*******'],
|
||||
[' ***** ', '* *', ' *', ' ** ', ' *', '* *', ' ***** '],
|
||||
[' * ', ' ** ', ' * * ', ' * * ', '*******', ' * ', ' * '],
|
||||
['*******', '* ', '****** ', ' *', ' *', '* *', ' ***** '],
|
||||
[' **** ', ' * ', '* ', '****** ', '* *', '* *', ' ***** '],
|
||||
['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '* '],
|
||||
[' ***** ', '* *', '* *', ' ***** ', '* *', '* *', ' ***** '],
|
||||
[' ***** ', '* *', '* *', ' ******', ' *', ' * ', ' **** ']];
|
||||
|
||||
$.extend(RealPerson.prototype, {
|
||||
/* Class name added to elements to indicate already configured with real person. */
|
||||
markerClassName: 'hasRealPerson',
|
||||
|
||||
/* Override the default settings for all real person instances.
|
||||
@param settings (object) the new settings to use as defaults
|
||||
@return (RealPerson) this object */
|
||||
setDefaults: function(settings) {
|
||||
$.extend(this._defaults, settings || {});
|
||||
return this;
|
||||
},
|
||||
|
||||
/* Attach the real person functionality to an input field.
|
||||
@param target (element) the control to affect
|
||||
@param settings (object) the custom options for this instance */
|
||||
_attachRealPerson: function(target, settings) {
|
||||
target = $(target);
|
||||
if (target.hasClass(this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
target.addClass(this.markerClassName);
|
||||
var inst = {settings: $.extend({}, this._defaults)};
|
||||
$.data(target[0], PROP_NAME, inst);
|
||||
this._changeRealPerson(target, settings);
|
||||
},
|
||||
|
||||
/* Reconfigure the settings for a real person control.
|
||||
@param target (element) the control to affect
|
||||
@param settings (object) the new options for this instance or
|
||||
(string) an individual property name
|
||||
@param value (any) the individual property value (omit if settings is an object) */
|
||||
_changeRealPerson: function(target, settings, value) {
|
||||
target = $(target);
|
||||
if (!target.hasClass(this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
settings = settings || {};
|
||||
if (typeof settings == 'string') {
|
||||
var name = settings;
|
||||
settings = {};
|
||||
settings[name] = value;
|
||||
}
|
||||
var inst = $.data(target[0], PROP_NAME);
|
||||
$.extend(inst.settings, settings);
|
||||
target.prevAll('.realperson-challenge,.realperson-hash').remove().end().
|
||||
before(this._generateHTML(target, inst));
|
||||
},
|
||||
|
||||
/* Generate the additional content for this control.
|
||||
@param target (jQuery) the input field
|
||||
@param inst (object) the current instance settings
|
||||
@return (string) the additional content */
|
||||
_generateHTML: function(target, inst) {
|
||||
var text = '';
|
||||
for (var i = 0; i < inst.settings.length; i++) {
|
||||
text += CHARS.charAt(Math.floor(Math.random() *
|
||||
(inst.settings.includeNumbers ? 36 : 26)));
|
||||
}
|
||||
var html = '<div class="realperson-challenge"><div class="realperson-text">';
|
||||
for (var i = 0; i < DOTS[0].length; i++) {
|
||||
for (var j = 0; j < text.length; j++) {
|
||||
html += DOTS[CHARS.indexOf(text.charAt(j))][i].replace(/ /g, ' ') +
|
||||
' ';
|
||||
}
|
||||
html += '<br>';
|
||||
}
|
||||
html += '</div><div class="realperson-regen">' + inst.settings.regenerate +
|
||||
'</div></div><input type="hidden" class="realperson-hash" name="' +
|
||||
inst.settings.hashName.replace(/\{n\}/, target.attr('name')) +
|
||||
'" value="' + this._hash(text) + '">';
|
||||
return html;
|
||||
},
|
||||
|
||||
/* Remove the real person functionality from a control.
|
||||
@param target (element) the control to affect */
|
||||
_destroyRealPerson: function(target) {
|
||||
target = $(target);
|
||||
if (!target.hasClass(this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
target.removeClass(this.markerClassName).
|
||||
prevAll('.realperson-challenge,.realperson-hash').remove();
|
||||
$.removeData(target[0], PROP_NAME);
|
||||
},
|
||||
|
||||
/* Compute a hash value for the given text.
|
||||
@param value (string) the text to hash
|
||||
@return the corresponding hash value */
|
||||
_hash: function(value) {
|
||||
var hash = 5381;
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
hash = ((hash << 5) + hash) + value.charCodeAt(i);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
});
|
||||
|
||||
/* Attach the real person functionality to a jQuery selection.
|
||||
@param command (string) the command to run (optional, default 'attach')
|
||||
@param options (object) the new settings to use for these instances (optional)
|
||||
@return (jQuery) for chaining further calls */
|
||||
$.fn.realperson = function(options) {
|
||||
var otherArgs = Array.prototype.slice.call(arguments, 1);
|
||||
return this.each(function() {
|
||||
if (typeof options == 'string') {
|
||||
$.realperson['_' + options + 'RealPerson'].
|
||||
apply($.realperson, [this].concat(otherArgs));
|
||||
}
|
||||
else {
|
||||
$.realperson._attachRealPerson(this, options || {});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* Initialise the real person functionality. */
|
||||
$.realperson = new RealPerson(); // singleton instance
|
||||
|
||||
$('.realperson-challenge').live('click', function() {
|
||||
$(this).next().next().realperson('change');
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -1,11 +0,0 @@
|
|||
/**
|
||||
* jQuery.ScrollTo - Easy element scrolling using jQuery.
|
||||
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
|
||||
* Dual licensed under MIT and GPL.
|
||||
* Date: 5/25/2009
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.2
|
||||
*
|
||||
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
|
||||
*/
|
||||
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
97
webapp/web/js/jquery_plugins/supersleight.js
vendored
|
@ -1,97 +0,0 @@
|
|||
// SuperSleight, version 1.1.0
|
||||
// version 1.1.0 by Jeffrey Barke <http://themechanism.com/> 20071218
|
||||
// Essential (99% of the) code by Drew McLellan <http://24ways.org/2007/supersleight-transparent-png-in-ie6>
|
||||
var supersleight = function() {
|
||||
|
||||
// local vars
|
||||
var root = false;
|
||||
var applyPositioning = false;
|
||||
// path to a transparent GIF image
|
||||
var shim = './images/x.gif';
|
||||
|
||||
var fnLoadPngs = function() {
|
||||
// if supersleight.limitTo called, limit to specified id
|
||||
if (root) { root = document.getElementById(root); } else { root = document; }
|
||||
// loop
|
||||
for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
|
||||
// background pngs
|
||||
if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) {
|
||||
bg_fnFixPng(obj);
|
||||
}
|
||||
// image elements
|
||||
if (obj.tagName == 'IMG' && obj.src.match(/\.png$/i) !== null) {
|
||||
el_fnFixPng(obj);
|
||||
}
|
||||
// apply position to 'active' elements
|
||||
if (applyPositioning && (obj.tagName == 'A' || obj.tagName == 'INPUT') && obj.style.position === '') {
|
||||
obj.style.position = 'relative';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var bg_fnFixPng = function(obj) {
|
||||
var mode = 'scale';
|
||||
var bg = obj.currentStyle.backgroundImage;
|
||||
var src = bg.substring(5,bg.length-2);
|
||||
if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
|
||||
mode = 'crop';
|
||||
}
|
||||
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
|
||||
obj.style.backgroundImage = 'url(' + shim + ')';
|
||||
};
|
||||
|
||||
var el_fnFixPng = function(img) {
|
||||
var src = img.src;
|
||||
img.style.width = img.width + 'px';
|
||||
img.style.height = img.height + 'px';
|
||||
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
|
||||
img.src = shim;
|
||||
};
|
||||
|
||||
var addLoadEvent = function(func) {
|
||||
var oldonload = window.onload;
|
||||
if (typeof window.onload != 'function') {
|
||||
window.onload = func;
|
||||
} else {
|
||||
window.onload = function() {
|
||||
if (oldonload) {
|
||||
oldonload();
|
||||
}
|
||||
func();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// supersleight object
|
||||
return {
|
||||
init: function(strPath, blnPos, strId) {
|
||||
if (document.getElementById) {
|
||||
if (typeof(strPath) != 'undefined' && null !== strPath) { shim = strPath; }
|
||||
if (typeof(blnPos) != 'undefined' && null !== blnPos) { applyPositioning = blnPos; }
|
||||
if (typeof(strId) != 'undefined' && null !== strId) { root = strId; }
|
||||
addLoadEvent(fnLoadPngs);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
limitTo: function(el) {
|
||||
root = el;
|
||||
},
|
||||
run: function(strPath, blnPos, strId) {
|
||||
if (document.getElementById) {
|
||||
if (typeof(strPath) != 'undefined' && null !== strPath) { shim = strPath; }
|
||||
if (typeof(blnPos) != 'undefined' && null !== blnPos) { applyPositioning = blnPos; }
|
||||
if (typeof(strId) != 'undefined' && null !== strId) { root = strId; }
|
||||
fnLoadPngs();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}();
|
||||
|
||||
// limit to part of the page ... pass an ID to limitTo:
|
||||
// supersleight.limitTo('top');
|
||||
// optional path to a transparent GIF image, apply positioning, limitTo
|
||||
supersleight.init();
|
|
@ -1,208 +0,0 @@
|
|||
/* Main Style Sheet for jQuery UI date picker */
|
||||
#datepicker_div, .datepicker_inline {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: #ddd;
|
||||
width: 185px;
|
||||
}
|
||||
#datepicker_div {
|
||||
display: none;
|
||||
border: 1px solid #777;
|
||||
z-index: 9999; /*must have*/
|
||||
}
|
||||
.datepicker_inline {
|
||||
float: left;
|
||||
display: block;
|
||||
border: 0;
|
||||
}
|
||||
.datepicker_rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.datepicker_dialog {
|
||||
padding: 5px !important;
|
||||
border: 4px ridge #ddd !important;
|
||||
}
|
||||
button.datepicker_trigger {
|
||||
width: 25px;
|
||||
}
|
||||
img.datepicker_trigger {
|
||||
margin: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.datepicker_prompt {
|
||||
float: left;
|
||||
padding: 2px;
|
||||
background: #ddd;
|
||||
color: #000;
|
||||
}
|
||||
* html .datepicker_prompt {
|
||||
width: 185px;
|
||||
}
|
||||
.datepicker_control, .datepicker_links, .datepicker_header, .datepicker {
|
||||
clear: both;
|
||||
float: left;
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
}
|
||||
.datepicker_control {
|
||||
background: #400;
|
||||
padding: 2px 0px;
|
||||
}
|
||||
.datepicker_links {
|
||||
background: #000;
|
||||
padding: 2px 0px;
|
||||
}
|
||||
.datepicker_control, .datepicker_links {
|
||||
font-weight: bold;
|
||||
font-size: 80%;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.datepicker_links label { /* disabled links */
|
||||
padding: 2px 5px;
|
||||
color: #888;
|
||||
}
|
||||
.datepicker_clear, .datepicker_prev {
|
||||
float: left;
|
||||
width: 34%;
|
||||
}
|
||||
.datepicker_rtl .datepicker_clear, .datepicker_rtl .datepicker_prev {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.datepicker_current {
|
||||
float: left;
|
||||
width: 30%;
|
||||
text-align: center;
|
||||
}
|
||||
.datepicker_close, .datepicker_next {
|
||||
float: right;
|
||||
width: 34%;
|
||||
text-align: right;
|
||||
}
|
||||
.datepicker_rtl .datepicker_close, .datepicker_rtl .datepicker_next {
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
.datepicker_header {
|
||||
padding: 1px 0 3px;
|
||||
background: #333;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
height: 1.3em;
|
||||
}
|
||||
.datepicker_header select {
|
||||
background: #333;
|
||||
color: #fff;
|
||||
border: 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.datepicker {
|
||||
background: #ccc;
|
||||
text-align: center;
|
||||
font-size: 100%;
|
||||
}
|
||||
.datepicker a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.datepicker_titleRow {
|
||||
background: #777;
|
||||
}
|
||||
.datepicker_daysRow {
|
||||
background: #eee;
|
||||
color: #666;
|
||||
}
|
||||
.datepicker_weekCol {
|
||||
background: #777;
|
||||
color: #fff;
|
||||
}
|
||||
.datepicker_daysCell {
|
||||
color: #000;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.datepicker_daysCell a{
|
||||
display: block;
|
||||
}
|
||||
.datepicker_weekEndCell {
|
||||
background: #ddd;
|
||||
}
|
||||
.datepicker_titleRow .datepicker_weekEndCell {
|
||||
background: #777;
|
||||
}
|
||||
.datepicker_daysCellOver {
|
||||
background: #fff;
|
||||
border: 1px solid #777;
|
||||
}
|
||||
.datepicker_unselectable {
|
||||
color: #888;
|
||||
}
|
||||
.datepicker_today {
|
||||
background: #fcc !important;
|
||||
}
|
||||
.datepicker_currentDay {
|
||||
background: #999 !important;
|
||||
}
|
||||
.datepicker_status {
|
||||
background: #ddd;
|
||||
width: 100%;
|
||||
font-size: 80%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ________ Datepicker Links _______
|
||||
|
||||
** Reset link properties and then override them with !important */
|
||||
#datepicker_div a, .datepicker_inline a {
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: none;
|
||||
color: #000;
|
||||
}
|
||||
.datepicker_inline .datepicker_links a {
|
||||
padding: 0 5px !important;
|
||||
}
|
||||
.datepicker_control a, .datepicker_links a {
|
||||
padding: 2px 5px !important;
|
||||
color: #eee !important;
|
||||
}
|
||||
.datepicker_titleRow a {
|
||||
color: #eee !important;
|
||||
}
|
||||
.datepicker_control a:hover {
|
||||
background: #fdd !important;
|
||||
color: #333 !important;
|
||||
}
|
||||
.datepicker_links a:hover, .datepicker_titleRow a:hover {
|
||||
background: #ddd !important;
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
/* ___________ MULTIPLE MONTHS _________*/
|
||||
|
||||
.datepicker_multi .datepicker {
|
||||
border: 1px solid #777;
|
||||
}
|
||||
.datepicker_oneMonth {
|
||||
float: left;
|
||||
width: 185px;
|
||||
}
|
||||
.datepicker_newRow {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
/* ___________ IE6 IFRAME FIX ________ */
|
||||
|
||||
.datepicker_cover {
|
||||
display: none; /*sorry for IE5*/
|
||||
display/**/: block; /*sorry for IE5*/
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}
|
|
@ -1,487 +0,0 @@
|
|||
/*
|
||||
json2.js
|
||||
2011-10-19
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
|
||||
This code should be minified before deployment.
|
||||
See http://javascript.crockford.com/jsmin.html
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
NOT CONTROL.
|
||||
|
||||
|
||||
This file creates a global JSON object containing two methods: stringify
|
||||
and parse.
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects. It can be a
|
||||
function or an array of strings.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t' or ' '),
|
||||
it contains the characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method
|
||||
will be passed the key associated with the value, and this will be
|
||||
bound to the value
|
||||
|
||||
For example, this would serialize Dates as ISO strings.
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If the replacer parameter is an array of strings, then it will be
|
||||
used to select the members to be serialized. It filters the results
|
||||
such that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representations, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the
|
||||
value that is filled with line breaks and indentation to make it
|
||||
easier to read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
the indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
text = JSON.stringify([new Date()], function (key, value) {
|
||||
return this[key] instanceof Date ?
|
||||
'Date(' + this[key] + ')' : value;
|
||||
});
|
||||
// text is '["Date(---current time---)"]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
||||
var d;
|
||||
if (typeof value === 'string' &&
|
||||
value.slice(0, 5) === 'Date(' &&
|
||||
value.slice(-1) === ')') {
|
||||
d = new Date(value.slice(5, -1));
|
||||
if (d) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
*/
|
||||
|
||||
/*jslint evil: true, regexp: true */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
||||
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
||||
test, toJSON, toString, valueOf
|
||||
*/
|
||||
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// methods in a closure to avoid creating global variables.
|
||||
|
||||
var JSON;
|
||||
if (!JSON) {
|
||||
JSON = {};
|
||||
}
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// Is the value an array?
|
||||
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
|
||||
// The value is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
// If the JSON object does not yet have a stringify method, give it one.
|
||||
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
|
||||
// If there is a replacer, it must be a function or an array.
|
||||
// Otherwise, throw an error.
|
||||
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// If the JSON object does not yet have a parse method, give it one.
|
||||
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in four stages. In the first stage, we replace certain
|
||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
|
||||
// In the second stage, we run the text against regular expressions that look
|
||||
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
||||
// because they can cause invocation, and '=' because it can cause mutation.
|
||||
// But just to be safe, we want to reject all unexpected forms.
|
||||
|
||||
// We split the second stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the third stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
|
@ -1,29 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(function() {
|
||||
|
||||
$.extend(this, i18nStringsLangMenu);
|
||||
var theText = this.selectLanguage;
|
||||
var imgHTML = "";
|
||||
$("ul.language-dropdown li#language-menu").hover(function(){
|
||||
$("a#lang-link").html(theText);
|
||||
$(this).addClass("hover");
|
||||
$('ul:first',this).css('visibility', 'visible');
|
||||
$("ul.language-dropdown ul.sub_menu li").css('width', ($("ul.language-dropdown").width() - 4) + 'px');
|
||||
|
||||
}, function(){
|
||||
$("a#lang-link").html(imgHTML);
|
||||
$(this).removeClass("hover");
|
||||
$('ul:first',this).css('visibility', 'hidden');
|
||||
});
|
||||
|
||||
$("ul.language-dropdown li ul li:has(ul)").find("a:first").append(" » ");
|
||||
|
||||
$("ul.language-dropdown ul.sub_menu li").each(function() {
|
||||
if ( $(this).attr("status") == "selected" ) {
|
||||
$("a#lang-link").html($(this).children("a").html());
|
||||
imgHTML = $(this).children("a").html();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
|
@ -1,19 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// login form is hidden by default; use JavaScript to reveal
|
||||
$("#login").removeClass('hidden');
|
||||
|
||||
// focus on email or newpassword field
|
||||
$('.focus').focus();
|
||||
|
||||
// fade in error alerts
|
||||
$('section#error-alert').css('display', 'none').fadeIn(1500);
|
||||
|
||||
// toggle vivo account authentication form
|
||||
$('h3.internal-auth').click(function() {
|
||||
$('.vivoAccount').toggle();
|
||||
});
|
||||
|
||||
});
|
|
@ -1,249 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var browseByVClass = {
|
||||
// Initial page setup
|
||||
onLoad: function() {
|
||||
this.mergeFromTemplate();
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
this.defaultVClass();
|
||||
},
|
||||
|
||||
// Add variables from menupage template
|
||||
mergeFromTemplate: function() {
|
||||
$.extend(this, menupageData);
|
||||
$.extend(this, i18nStrings);
|
||||
},
|
||||
|
||||
// Create references to frequently used elements for convenience
|
||||
initObjects: function() {
|
||||
this.vgraphVClasses = $('#vgraph-classes');
|
||||
this.vgraphVClassLinks = $('#vgraph-classes li a');
|
||||
this.browseVClasses = $('#browse-classes');
|
||||
this.browseVClassLinks = $('#browse-classes li a');
|
||||
this.alphaIndex = $('#alpha-browse-individuals');
|
||||
this.alphaIndexLinks = $('#alpha-browse-individuals li a');
|
||||
this.individualsInVClass = $('#individuals-in-class ul');
|
||||
this.individualsContainer = $('#individuals-in-class');
|
||||
},
|
||||
|
||||
// Event listeners. Called on page load
|
||||
bindEventListeners: function() {
|
||||
// Listeners for vClass switching
|
||||
this.vgraphVClassLinks.click(function() {
|
||||
var uri = $(this).attr('data-uri');
|
||||
browseByVClass.getIndividuals(uri);
|
||||
});
|
||||
|
||||
this.browseVClassLinks.click(function() {
|
||||
var uri = $(this).attr('data-uri');
|
||||
browseByVClass.getIndividuals(uri);
|
||||
return false;
|
||||
});
|
||||
|
||||
// Listener for alpha switching
|
||||
this.alphaIndexLinks.click(function() {
|
||||
var uri = $('#browse-classes li a.selected').attr('data-uri');
|
||||
var alpha = $(this).attr('data-alpha');
|
||||
browseByVClass.getIndividuals(uri, alpha);
|
||||
return false;
|
||||
});
|
||||
|
||||
// save the selected vclass in location hash so we can reset the selection
|
||||
// if the user navigates with the back button
|
||||
this.browseVClasses.children('li').each( function() {
|
||||
$(this).find('a').click(function () {
|
||||
// the extra space is needed to prevent odd scrolling behavior
|
||||
location.hash = $(this).attr('data-uri') + ' ';
|
||||
});
|
||||
});
|
||||
|
||||
// Call the pagination listener
|
||||
this.paginationListener();
|
||||
},
|
||||
|
||||
// Listener for page switching -- separate from the rest because it needs to be callable
|
||||
paginationListener: function() {
|
||||
$('.pagination li a').click(function() {
|
||||
var uri = $('#browse-classes li a.selected').attr('data-uri');
|
||||
var alpha = $('#alpha-browse-individuals li a.selected').attr('data-alpha');
|
||||
var page = $(this).attr('data-page');
|
||||
browseByVClass.getIndividuals(uri, alpha, page);
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
// Load individuals for default class as specified by menupage template
|
||||
defaultVClass: function() {
|
||||
if ( this.defaultBrowseVClassURI != "false" ) {
|
||||
if ( location.hash ) {
|
||||
// remove the trailing white space
|
||||
location.hash = location.hash.replace(/\s+/g, '');
|
||||
this.getIndividuals(location.hash.substring(1,location.hash.length), "all", 1, false);
|
||||
}
|
||||
else {
|
||||
this.getIndividuals(this.defaultBrowseVClassUri, "all", 1, false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Where all the magic happens -- gonna fetch me some individuals
|
||||
getIndividuals: function(vclassUri, alpha, page, scroll) {
|
||||
var url = this.dataServiceUrl + encodeURIComponent(vclassUri);
|
||||
if ( alpha && alpha != "all") {
|
||||
url += '&alpha=' + alpha;
|
||||
}
|
||||
if ( page ) {
|
||||
url += '&page=' + page;
|
||||
} else {
|
||||
page = 1;
|
||||
}
|
||||
if ( typeof scroll === "undefined" ) {
|
||||
scroll = true;
|
||||
}
|
||||
|
||||
// Scroll to #menupage-intro page unless told otherwise
|
||||
if ( scroll != false ) {
|
||||
// only scroll back up if we're past the top of the #browse-by section
|
||||
var scrollPosition = browseByVClass.getPageScroll();
|
||||
var browseByOffset = $('#browse-by').offset();
|
||||
if ( scrollPosition[1] > browseByOffset.top) {
|
||||
$.scrollTo('#menupage-intro', 500);
|
||||
}
|
||||
}
|
||||
|
||||
$.getJSON(url, function(results) {
|
||||
var individualList = "";
|
||||
|
||||
// Catch exceptions when empty individuals result set is returned
|
||||
// This is very likely to happen now since we don't have individual counts for each letter and always allow the result set to be filtered by any letter
|
||||
if ( results.individuals.length == 0 ) {
|
||||
browseByVClass.emptyResultSet(results.vclass, alpha)
|
||||
} else {
|
||||
var vclassName = results.vclass.name;
|
||||
$.each(results.individuals, function(i, item) {
|
||||
var individual = results.individuals[i];
|
||||
individualList += individual.shortViewHtml;
|
||||
})
|
||||
|
||||
// Remove existing content
|
||||
browseByVClass.wipeSlate();
|
||||
|
||||
// And then add the new content
|
||||
browseByVClass.individualsInVClass.append(individualList);
|
||||
|
||||
// Check to see if we're dealing with pagination
|
||||
if ( results.pages.length ) {
|
||||
var pages = results.pages;
|
||||
browseByVClass.pagination(pages, page);
|
||||
}
|
||||
}
|
||||
|
||||
// Set selected class, alpha and page
|
||||
// Do this whether or not there are any results
|
||||
$('h3.selected-class').text(results.vclass.name);
|
||||
browseByVClass.selectedVClass(results.vclass.URI);
|
||||
browseByVClass.selectedAlpha(alpha);
|
||||
});
|
||||
},
|
||||
|
||||
// getPageScroll() by quirksmode.org
|
||||
getPageScroll: function() {
|
||||
var xScroll, yScroll;
|
||||
if (self.pageYOffset) {
|
||||
yScroll = self.pageYOffset;
|
||||
xScroll = self.pageXOffset;
|
||||
} else if (document.documentElement && document.documentElement.scrollTop) {
|
||||
yScroll = document.documentElement.scrollTop;
|
||||
xScroll = document.documentElement.scrollLeft;
|
||||
} else if (document.body) {// all other Explorers
|
||||
yScroll = document.body.scrollTop;
|
||||
xScroll = document.body.scrollLeft;
|
||||
}
|
||||
return new Array(xScroll,yScroll)
|
||||
},
|
||||
|
||||
// Print out the pagination nav if called
|
||||
pagination: function(pages, page) {
|
||||
var pagination = '<div class="pagination menupage">';
|
||||
pagination += '<h3>' + browseByVClass.pageString + '</h3>';
|
||||
pagination += '<ul>';
|
||||
$.each(pages, function(i, item) {
|
||||
var anchorOpen = '<a class="round" href="#" title="' + browseByVClass.viewPageString + ' '
|
||||
+ pages[i].text + ' '
|
||||
+ browseByVClass.ofTheResults + ' " data-page="'+ pages[i].index +'">';
|
||||
var anchorClose = '</a>';
|
||||
|
||||
pagination += '<li class="round';
|
||||
// Test for active page
|
||||
if ( pages[i].text == page) {
|
||||
pagination += ' selected';
|
||||
anchorOpen = "";
|
||||
anchorClose = "";
|
||||
}
|
||||
pagination += '" role="listitem">';
|
||||
pagination += anchorOpen;
|
||||
pagination += pages[i].text;
|
||||
pagination += anchorClose;
|
||||
pagination += '</li>';
|
||||
})
|
||||
pagination += '</ul>';
|
||||
|
||||
// Add the pagination above and below the list of individuals and call the listener
|
||||
browseByVClass.individualsContainer.prepend(pagination);
|
||||
browseByVClass.individualsContainer.append(pagination);
|
||||
browseByVClass.paginationListener();
|
||||
},
|
||||
|
||||
// Toggle the active class so it's clear which is selected
|
||||
selectedVClass: function(vclassUri) {
|
||||
// Remove active class on all vClasses
|
||||
$('#browse-classes li a.selected').removeClass('selected');
|
||||
|
||||
// Add active class for requested vClass
|
||||
$('#browse-classes li a[data-uri="'+ vclassUri +'"]').addClass('selected');
|
||||
},
|
||||
|
||||
// Toggle the active letter so it's clear which is selected
|
||||
selectedAlpha: function(alpha) {
|
||||
// if no alpha argument sent, assume all
|
||||
if ( alpha == null ) {
|
||||
alpha = "all";
|
||||
}
|
||||
// Remove active class on all letters
|
||||
$('#alpha-browse-individuals li a.selected').removeClass('selected');
|
||||
|
||||
// Add active class for requested alpha
|
||||
$('#alpha-browse-individuals li a[data-alpha="'+ alpha +'"]').addClass('selected');
|
||||
|
||||
return alpha;
|
||||
},
|
||||
|
||||
// Wipe the currently displayed individuals, no-content message, and existing pagination
|
||||
wipeSlate: function() {
|
||||
browseByVClass.individualsInVClass.empty();
|
||||
$('p.no-individuals').remove();
|
||||
$('.pagination').remove();
|
||||
},
|
||||
|
||||
// When no individuals are returned for the AJAX request, print a reasonable message for the user
|
||||
emptyResultSet: function(vclass, alpha) {
|
||||
var nothingToSeeHere;
|
||||
|
||||
this.wipeSlate();
|
||||
var alpha = this.selectedAlpha(alpha);
|
||||
|
||||
if ( alpha != "all" ) {
|
||||
nothingToSeeHere = '<p class="no-individuals">' + browseByVClass.thereAreNo + ' ' + vclass.name + ' ' + browseByVClass.indNamesStartWith + ' <em>'+ alpha.toUpperCase() +'</em>.</p> <p class="no-individuals">' + browseByVClass.tryAnotherLetter + '</p>';
|
||||
} else {
|
||||
nothingToSeeHere = '<p class="no-individuals">' + browseByVClass.thereAreNo + ' ' + vclass.name + ' ' + browseByVClass.indsInSystem + '</p> <p class="no-individuals">' + browseByVClass.selectAnotherClass + '</p>';
|
||||
}
|
||||
|
||||
browseByVClass.individualsContainer.prepend(nothingToSeeHere);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
browseByVClass.onLoad();
|
||||
});
|
|
@ -1,174 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var menuManagementEdit = {
|
||||
onLoad: function() {
|
||||
$.extend(this, i18nStrings);
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
this.toggleClassSelection();
|
||||
},
|
||||
initObjects: function() {
|
||||
this.defaultTemplateRadio = $('input.default-template');
|
||||
this.customTemplateRadio = $('input.custom-template');
|
||||
this.customTemplate = $('#custom-template');
|
||||
this.changeContentType = $('#changeContentType');
|
||||
this.selectContentType = $('#selectContentType');
|
||||
this.existingContentType = $('#existingContentType');
|
||||
this.selectClassGroupDropdown = $('#selectClassGroup');
|
||||
this.classesForClassGroup = $('#classesInSelectedGroup');
|
||||
this.selectedGroupForPage = $('#selectedContentTypeValue');
|
||||
this.allClassesSelectedCheckbox = $('#allSelected');
|
||||
this.displayInternalMessage = $('#internal-class label em');
|
||||
},
|
||||
bindEventListeners: function() {
|
||||
// Listeners for vClass switching
|
||||
this.changeContentType.click(function() {
|
||||
menuManagementEdit.showClassGroups();
|
||||
|
||||
return false;
|
||||
});
|
||||
this.selectClassGroupDropdown.change(function() {
|
||||
menuManagementEdit.chooseClassGroup();
|
||||
});
|
||||
|
||||
// Listeners for template field
|
||||
this.defaultTemplateRadio.click(function(){
|
||||
menuManagementEdit.customTemplate.addClass('hidden');
|
||||
});
|
||||
this.customTemplateRadio.click(function(){
|
||||
// If checked, hide this input element
|
||||
menuManagementEdit.customTemplate.removeClass('hidden');
|
||||
});
|
||||
$("form").submit(function () {
|
||||
var validationError = menuManagementEdit.validateMenuItemForm();
|
||||
if (validationError == "") {
|
||||
$(this).submit();
|
||||
} else{
|
||||
$('#error-alert').removeClass('hidden');
|
||||
$('#error-alert p').html(validationError);
|
||||
$.scrollTo({ top:0, left:0}, 500)
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
updateInternalClassMessage:function(classGroupName) { //User has changed content type
|
||||
//Set content type within internal class message
|
||||
this.displayInternalMessage.filter(":first").html(classGroupName);
|
||||
},
|
||||
showClassGroups: function() { //User has clicked change content type
|
||||
//Show the section with the class group dropdown
|
||||
this.selectContentType.removeClass("hidden");
|
||||
//Hide the "change content type" section which shows the selected class group
|
||||
this.existingContentType.addClass("hidden");
|
||||
//Hide the checkboxes for classes within the class group
|
||||
this.classesForClassGroup.addClass("hidden");
|
||||
},
|
||||
hideClassGroups: function() { //User has selected class group/content type, page should show classes for class group and 'existing' type with change link
|
||||
//Hide the class group dropdown
|
||||
this.selectContentType.addClass("hidden");
|
||||
//Show the "change content type" section which shows the selected class group
|
||||
this.existingContentType.removeClass("hidden");
|
||||
//Show the classes in the class group
|
||||
this.classesForClassGroup.removeClass("hidden");
|
||||
|
||||
},
|
||||
toggleClassSelection: function() {
|
||||
// Check/unckeck all classes for selection
|
||||
$('input:checkbox[name=allSelected]').click(function(){
|
||||
if ( this.checked ) {
|
||||
// if checked, select all the checkboxes
|
||||
$('input:checkbox[name=classInClassGroup]').attr('checked','checked');
|
||||
|
||||
} else {
|
||||
// if not checked, deselect all the checkboxes
|
||||
$('input:checkbox[name=classInClassGroup]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
$('input:checkbox[name=classInClassGroup]').click(function(){
|
||||
$('input:checkbox[name=allSelected]').removeAttr('checked');
|
||||
});
|
||||
},
|
||||
validateMenuItemForm: function() {
|
||||
var validationError = "";
|
||||
|
||||
// Check menu name
|
||||
if ($('input[type=text][name=menuName]').val() == "") {
|
||||
validationError += menuManagementEdit.supplyName + "<br />";
|
||||
}
|
||||
// Check pretty url
|
||||
if ($('input[type=text][name=prettyUrl]').val() == "") {
|
||||
validationError += menuManagementEdit.supplyPrettyUrl + "<br />";
|
||||
}
|
||||
if ($('input[type=text][name=prettyUrl]').val().charAt(0) != "/") {
|
||||
validationError += menuManagementEdit.startUrlWithSlash + "<br />";
|
||||
}
|
||||
|
||||
// Check custom template
|
||||
if ($('input:radio[name=selectedTemplate]:checked').val() == "custom") {
|
||||
if ($('input[name=customTemplate]').val() == "") {
|
||||
validationError += menuManagementEdit.supplyTemplate + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
// if no class group selected, this is an error
|
||||
if ($('#selectClassGroup').val() =='-1') {
|
||||
validationError += menuManagementEdit.supplyContentType + "<br />";
|
||||
} else {
|
||||
//class group has been selected, make sure there is at least one class selected
|
||||
var allSelected = $('input[name="allSelected"]:checked').length;
|
||||
var noClassesSelected = $('input[name="classInClassGroup"]:checked').length;
|
||||
if (allSelected == 0 && noClassesSelected == 0) {
|
||||
//at least one class should be selected
|
||||
validationError += menuManagementEdit.selectContentType + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//check select class group
|
||||
|
||||
return validationError;
|
||||
},
|
||||
chooseClassGroup: function() {
|
||||
var url = "dataservice?getVClassesForVClassGroup=1&classgroupUri=";
|
||||
var vclassUri = this.selectClassGroupDropdown.val();
|
||||
url += encodeURIComponent(vclassUri);
|
||||
//Make ajax call to retrieve vclasses
|
||||
$.getJSON(url, function(results) {
|
||||
|
||||
if ( results.classes.length == 0 ) {
|
||||
|
||||
} else {
|
||||
//update existing content type with correct class group name and hide class group select again
|
||||
var _this = menuManagementEdit;
|
||||
menuManagementEdit.hideClassGroups();
|
||||
|
||||
menuManagementEdit.selectedGroupForPage.html(results.classGroupName);
|
||||
//update content type in message to "display x within my institution"
|
||||
menuManagementEdit.updateInternalClassMessage(results.classGroupName);
|
||||
//retrieve classes for class group and display with all selected
|
||||
var selectedClassesList = menuManagementEdit.classesForClassGroup.children('ul#selectedClasses');
|
||||
|
||||
selectedClassesList.empty();
|
||||
selectedClassesList.append('<li class="ui-state-default"> <input type="checkbox" name="allSelected" id="allSelected" value="all" checked="checked" /> <label class="inline" for="All"> ' + menuManagementEdit.allCapitalized + '</label> </li>');
|
||||
|
||||
$.each(results.classes, function(i, item) {
|
||||
var thisClass = results.classes[i];
|
||||
var thisClassName = thisClass.name;
|
||||
//When first selecting new content type, all classes should be selected
|
||||
appendHtml = ' <li class="ui-state-default">' +
|
||||
'<input type="checkbox" checked="checked" name="classInClassGroup" value="' + thisClass.URI + '" />' +
|
||||
'<label class="inline" for="' + thisClassName + '"> ' + thisClassName + '</label>' +
|
||||
'</li>';
|
||||
selectedClassesList.append(appendHtml);
|
||||
});
|
||||
menuManagementEdit.toggleClassSelection();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
menuManagementEdit.onLoad();
|
||||
});
|
|
@ -1,965 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var pageManagementUtils = {
|
||||
dataGetterLabelToURI:null,//initialized by custom data
|
||||
dataGetterURIToLabel:null, //initialized from custom data
|
||||
processDataGetterUtils:processDataGetterUtils,//an external class that should exist before this one
|
||||
dataGetterMap:null,
|
||||
menuAction:null,
|
||||
// on initial page setup
|
||||
onLoad:function(){
|
||||
if (this.disableFormInUnsupportedBrowsers()) {
|
||||
return;
|
||||
}
|
||||
this.mixIn();
|
||||
this.initReverseURIToLabel();
|
||||
this.initDataGetterProcessors();
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
this.initDisplay();
|
||||
//if edit, then generate existing content
|
||||
if(this.isEdit()) {
|
||||
this.initExistingContent();
|
||||
}
|
||||
},
|
||||
isEdit:function() {
|
||||
if(pageManagementUtils.menuAction != null && pageManagementUtils.menuAction == "Edit") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isAdd:function() {
|
||||
if(pageManagementUtils.menuAction != null && pageManagementUtils.menuAction == "Add") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isAddMenuItem:function() {
|
||||
if(pageManagementUtils.addMenuItem != null && pageManagementUtils.addMenuItem == "true") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
initExistingContent:function() {
|
||||
this.generateExistingContentSections();
|
||||
//display more content button - will need to review how to hit save etc.
|
||||
//Don't need to display this b/c already in appended section
|
||||
//pageManagementUtils.moreContentButton.show();
|
||||
//Need to have additional save button
|
||||
},
|
||||
initReverseURIToLabel:function() {
|
||||
if(this.dataGetterLabelToURI != null) {
|
||||
this.dataGetterURIToLabel = {};
|
||||
for(var label in this.dataGetterLabelToURI) {
|
||||
if(label != undefined) {
|
||||
var uri = this.dataGetterLabelToURI[label];
|
||||
this.dataGetterURIToLabel[uri] = label;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Error condition.
|
||||
}
|
||||
},
|
||||
initDataGetterProcessors:function() {
|
||||
//data getter processor map should come in from custom data
|
||||
//Go through each and initialize with their class
|
||||
|
||||
if(pageManagementUtils.processDataGetterUtils != null) {
|
||||
var dataGetterProcessorMap = pageManagementUtils.dataGetterProcessorMap = pageManagementUtils.processDataGetterUtils.dataGetterProcessorMap;
|
||||
$.each(dataGetterProcessorMap, function(key, dataGetterProcessorObject) {
|
||||
//passes class name from data getter label to uri to processor
|
||||
dataGetterProcessorObject.initProcessor(pageManagementUtils.dataGetterLabelToURI[key]);
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
disableFormInUnsupportedBrowsers: function() {
|
||||
var disableWrapper = $('#ie67DisableWrapper');
|
||||
|
||||
// Check for unsupported browsers only if the element exists on the page
|
||||
if (disableWrapper.length) {
|
||||
if (vitro.browserUtils.isIELessThan8()) {
|
||||
disableWrapper.show();
|
||||
$('.noIE67').hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
mixIn: function() {
|
||||
//Data getter process list input should be retrieved from the custom data
|
||||
// Mix in the custom form utility methods
|
||||
$.extend(this, vitro.customFormUtils);
|
||||
// Get the custom form data from the page
|
||||
$.extend(this, customFormData);
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
},
|
||||
initObjects:function(){
|
||||
this.counter = 0;
|
||||
this.contentTypeSelect = $("select#typeSelect");
|
||||
//list of options
|
||||
this.contentTypeSelectOptions = $('select#typeSelect option');
|
||||
this.classGroupSection = $("section#browseClassGroup");
|
||||
this.sparqlQuerySection = $("section#sparqlQuery");
|
||||
this.fixedHTMLSection = $("section#fixedHtml");
|
||||
this.searchIndividualsSection = $("section#searchIndividuals");
|
||||
//From original menu management edit
|
||||
this.defaultTemplateRadio = $('input.default-template');
|
||||
this.customTemplateRadio = $('input.custom-template');
|
||||
this.selfContainedTemplateRadio = $('input.selfContained-template');
|
||||
this.customTemplate = $('#custom-template');
|
||||
//In this version, these don't exist but we can consider this later
|
||||
// this.changeContentType = $('#changeContentType');
|
||||
// this.selectContentType = $('#selectContentType');
|
||||
// this.existingContentType = $('#existingContentType');
|
||||
this.selectClassGroupDropdown = $('select#selectClassGroup');
|
||||
this.classesForClassGroup = $('section#classesInSelectedGroup');
|
||||
this.selectedGroupForPage = $('#selectedContentTypeValue');
|
||||
this.allClassesSelectedCheckbox = $('#allSelected');
|
||||
|
||||
this.displayInternalMessage = $('#internal-class label em');
|
||||
this.pageContentSubmissionInputs = $("#pageContentSubmissionInputs");
|
||||
this.headerBar = $("section#headerBar");
|
||||
this.doneButton = $("input#doneWithContent");
|
||||
this.cancelLink = $("a#cancelContentLink");
|
||||
this.isMenuCheckbox = $("input#menuCheckbox");
|
||||
this.menuLinkText = $("input#menuLinkText");
|
||||
this.menuSection = $("section#menu");
|
||||
this.pageNameInput = $("input#pageName");
|
||||
this.pageSaveButton = $("input#pageSave");
|
||||
this.leftSideDiv = $("div#leftSide");
|
||||
this.rightSideDiv = $("div#rightSide");
|
||||
//contentDivs container where content added/existing placed
|
||||
this.savedContentDivs = $("section#contentDivs");
|
||||
//for search individuals data getter
|
||||
this.searchAllClassesDropdown = $("select#vclassUri");
|
||||
},
|
||||
initDisplay: function(){
|
||||
//right side components
|
||||
this.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
||||
$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
|
||||
|
||||
//Why would you want to hide this? This hides everything
|
||||
// $("section#pageDetails").hide();
|
||||
this.headerBar.hide();
|
||||
this.classGroupSection.hide();
|
||||
this.sparqlQuerySection.hide();
|
||||
this.fixedHTMLSection.hide();
|
||||
this.searchIndividualsSection.hide();
|
||||
this.classesForClassGroup.addClass('hidden');
|
||||
//left side components
|
||||
//These depend on whether or not this is an existing item or not
|
||||
if(this.isAdd()) {
|
||||
this.defaultTemplateRadio.attr('checked',true);
|
||||
//disable save button
|
||||
this.disablePageSave();
|
||||
if(!this.isAddMenuItem()) {
|
||||
this.isMenuCheckbox.attr('checked',false);
|
||||
this.menuSection.hide();
|
||||
}
|
||||
}
|
||||
//populates the dropdown of classes for the search individuals template
|
||||
//dropdown now populated in template/from form specific data instead of ajax request
|
||||
//this.populateClassForSearchDropdown();
|
||||
},
|
||||
//this method can be utilized if using an ajax request to get the vclasses
|
||||
/*
|
||||
//for search individuals - remember this populates the template class dropdown
|
||||
populateClassForSearchDropdown:function() {
|
||||
|
||||
//Run ajax query
|
||||
var url = "dataservice?getAllVClasses=1";
|
||||
|
||||
//Make ajax call to retrieve vclasses
|
||||
$.getJSON(url, function(results) {
|
||||
//Moved the function to processClassGroupDataGetterContent
|
||||
//Should probably remove this entire method and copy there
|
||||
pageManagementUtils.displayAllClassesForSearchDropdown(results);
|
||||
});
|
||||
},
|
||||
displayAllClassesForSearchDropdown:function(results) {
|
||||
if ( results.classes.length == 0 ) {
|
||||
|
||||
} else {
|
||||
var appendHtml = "";
|
||||
$.each(results.classes, function(i, item) {
|
||||
var thisClass = results.classes[i];
|
||||
var thisClassName = thisClass.name;
|
||||
//Create options for the dropdown
|
||||
appendHtml += "<option value='" + thisClass.URI + "'>" + thisClassName + "</option>";
|
||||
});
|
||||
|
||||
//if there are options to add
|
||||
if(appendHtml != "") {
|
||||
pageManagementUtils.searchAllClassesDropdown.html(appendHtml);
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
bindEventListeners:function(){
|
||||
|
||||
this.defaultTemplateRadio.click( function() {
|
||||
pageManagementUtils.customTemplate.addClass('hidden');
|
||||
//Also clear custom template value so as not to submit it
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.customTemplate);
|
||||
pageManagementUtils.rightSideDiv.show();
|
||||
//Check to see if there is already content on page, in which case save should be enabled
|
||||
var pageContentSections = $("section[class='pageContent']");
|
||||
if(pageContentSections.length == 0) {
|
||||
pageManagementUtils.disablePageSave();
|
||||
}
|
||||
});
|
||||
|
||||
this.customTemplateRadio.click( function() {
|
||||
pageManagementUtils.handleSelectCustomTemplate();
|
||||
});
|
||||
|
||||
this.selfContainedTemplateRadio.click( function() {
|
||||
pageManagementUtils.customTemplate.removeClass('hidden');
|
||||
pageManagementUtils.rightSideDiv.hide();
|
||||
pageManagementUtils.enablePageSave();
|
||||
});
|
||||
|
||||
this.isMenuCheckbox.click( function() {
|
||||
if ( pageManagementUtils.menuSection.is(':hidden') ) {
|
||||
pageManagementUtils.menuSection.show();
|
||||
}
|
||||
else {
|
||||
pageManagementUtils.menuSection.hide();
|
||||
}
|
||||
});
|
||||
|
||||
//Collapses the current content and creates a new section of content
|
||||
//Resets the content to be cloned to default settings
|
||||
this.doneButton.click( function() {
|
||||
pageManagementUtils.handleClickDone();
|
||||
});
|
||||
|
||||
this.cancelLink.click( function() {
|
||||
pageManagementUtils.clearSourceTemplateValues();
|
||||
pageManagementUtils.headerBar.hide();
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
||||
pageManagementUtils.contentTypeSelect.focus();
|
||||
pageManagementUtils.adjustSaveButtonHeight();
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
});
|
||||
//replacing with menu management edit version which is extended with some of the logic below
|
||||
//This is technically content specific and should be moved into the individual processor classes somehow
|
||||
this.selectClassGroupDropdown.change(function() {
|
||||
pageManagementUtils.chooseClassGroup();
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.contentTypeSelect.change( function() {
|
||||
pageManagementUtils.handleContentTypeSelect();
|
||||
});
|
||||
|
||||
|
||||
//Submission: validate as well as create appropriate hidden json inputs
|
||||
$("form").submit(function (event) {
|
||||
pageManagementUtils.handleFormSubmission(event);
|
||||
});
|
||||
|
||||
},
|
||||
handleSelectCustomTemplate: function() {
|
||||
pageManagementUtils.customTemplate.removeClass('hidden');
|
||||
pageManagementUtils.rightSideDiv.show();
|
||||
//Check to see if there is already content on page, in which case save should be enabled
|
||||
var pageContentSections = $("section[class='pageContent']");
|
||||
if(pageContentSections.length == 0) {
|
||||
pageManagementUtils.disablePageSave();
|
||||
}
|
||||
},
|
||||
|
||||
handleClickDone:function() {
|
||||
var selectedType = pageManagementUtils.contentTypeSelect.val();
|
||||
var selectedTypeText = $("#typeSelect option:selected").text();
|
||||
|
||||
//Hide all sections
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.hide();
|
||||
//Reset main content type drop-down
|
||||
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
||||
if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) {
|
||||
pageManagementUtils.leftSideDiv.css("height","");
|
||||
if ( pageManagementUtils.leftSideDiv.height() < pageManagementUtils.rightSideDiv.height() ) {
|
||||
pageManagementUtils.leftSideDiv.css("height",pageManagementUtils.rightSideDiv.height() + "px");
|
||||
}
|
||||
}
|
||||
pageManagementUtils.headerBar.hide();
|
||||
pageManagementUtils.headerBar.text("");
|
||||
pageManagementUtils.cloneContentArea(selectedType, selectedTypeText);
|
||||
//Reset class group section AFTER cloning not before
|
||||
pageManagementUtils.resetClassGroupSection();
|
||||
//Clear all inputs values
|
||||
pageManagementUtils.clearSourceTemplateValues();
|
||||
//If adding browse classgroup, need to remove the classgroup option from the dropdown
|
||||
if(selectedType == "browseClassGroup") {
|
||||
pageManagementUtils.handleAddBrowseClassGroupPageContent();
|
||||
}
|
||||
//Enable save button now that some content has been selected
|
||||
pageManagementUtils.enablePageSave();
|
||||
pageManagementUtils.contentTypeSelect.focus();
|
||||
|
||||
},
|
||||
//Form submission
|
||||
handleFormSubmission:function(event) {
|
||||
var validationError = pageManagementUtils.validateMenuItemForm();
|
||||
//Add any errors from page content sections if necessary
|
||||
// Only validate the content sections if the self contained template section is NOT selected tlw72
|
||||
if ( !pageManagementUtils.isSelfContainedTemplateChecked() ) {
|
||||
validationError += pageManagementUtils.validatePageContentSections();
|
||||
}
|
||||
if (validationError == "") {
|
||||
//Check if menu label needs to be page title
|
||||
pageManagementUtils.checkMenuTitleSubmission();
|
||||
//Create the appropriate json objects if necessary
|
||||
pageManagementUtils.createPageContentForSubmission();
|
||||
//pageManagementUtils.mapCustomTemplateName();
|
||||
pageManagementUtils.setUsesSelfContainedTemplateInput();
|
||||
return true;
|
||||
} else{
|
||||
$('#error-alert').removeClass('hidden');
|
||||
$('#error-alert p').html(validationError);
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
},
|
||||
checkMenuTitleSubmission:function() {
|
||||
var isMenu = pageManagementUtils.isMenuCheckbox.is(":checked");
|
||||
var linkText = pageManagementUtils.menuLinkText.val();
|
||||
if(isMenu && linkText == "") {
|
||||
//substitute with page title instead
|
||||
var pageName = pageManagementUtils.pageNameInput.val();
|
||||
pageManagementUtils.menuLinkText.val(pageName);
|
||||
}
|
||||
if(!isMenu && linkText.length > 0) {
|
||||
// if the isMenuCheckbox is unchecked, we need to clear the
|
||||
// menuLinkText field; otherwise, the page remains a menu
|
||||
pageManagementUtils.menuLinkText.val("");
|
||||
}
|
||||
},
|
||||
|
||||
//Select content type - this is content type specific
|
||||
//TODO: Find better way to refactor this and/or see if any of this display functionality can be moved into content type processing
|
||||
handleContentTypeSelect:function() {
|
||||
_this = pageManagementUtils;
|
||||
pageManagementUtils.clearSourceTemplateValues();
|
||||
if ( _this.contentTypeSelect.val() == "browseClassGroup" ) {
|
||||
pageManagementUtils.classGroupSection.show();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.hide();
|
||||
pageManagementUtils.headerBar.text(pageManagementUtils.browseClassGroup + " - ");
|
||||
pageManagementUtils.headerBar.show();
|
||||
$('div#selfContainedDiv').hide();
|
||||
}
|
||||
if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" || _this.contentTypeSelect.val() == "searchIndividuals") {
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
//if fixed html show that, otherwise show sparql results
|
||||
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
|
||||
pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - ");
|
||||
pageManagementUtils.fixedHTMLSection.show();
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.hide();
|
||||
}
|
||||
else if (_this.contentTypeSelect.val() == "sparqlQuery"){
|
||||
pageManagementUtils.headerBar.text(pageManagementUtils.sparqlResults + " - ");
|
||||
pageManagementUtils.sparqlQuerySection.show();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.hide();
|
||||
} else {
|
||||
//search individuals
|
||||
pageManagementUtils.headerBar.text(pageManagementUtils.searchIndividuals + " - ");
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.show();
|
||||
}
|
||||
|
||||
pageManagementUtils.headerBar.show();
|
||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
$('div#selfContainedDiv').hide();
|
||||
}
|
||||
if ( _this.contentTypeSelect.val() == "" ) {
|
||||
pageManagementUtils.classGroupSection.hide();
|
||||
pageManagementUtils.fixedHTMLSection.hide();
|
||||
pageManagementUtils.sparqlQuerySection.hide();
|
||||
pageManagementUtils.searchIndividualsSection.hide();
|
||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
pageManagementUtils.headerBar.hide();
|
||||
pageManagementUtils.headerBar.text("");
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
}
|
||||
//Collapse any divs for existing content if it exists
|
||||
pageManagementUtils.collapseAllExistingContent();
|
||||
//adjust save button height
|
||||
pageManagementUtils.adjustSaveButtonHeight();
|
||||
//Disable save button until the user has clicked done or cancel from the addition
|
||||
pageManagementUtils.disablePageSave();
|
||||
//If the default template is selected, there is already content on the page, and the user is selecting new content
|
||||
//display alert message that they must select a custom template and select
|
||||
pageManagementUtils.checkTemplateForMultipleContent(_this.contentTypeSelect.val());
|
||||
},
|
||||
disablePageSave:function() {
|
||||
pageManagementUtils.pageSaveButton.attr("disabled", "disabled");
|
||||
pageManagementUtils.pageSaveButton.addClass("disabledSubmit");
|
||||
},
|
||||
enablePageSave:function() {
|
||||
pageManagementUtils.pageSaveButton.removeAttr("disabled");
|
||||
pageManagementUtils.pageSaveButton.removeClass("disabledSubmit");
|
||||
},
|
||||
collapseAllExistingContent:function() {
|
||||
var spanArrows = pageManagementUtils.savedContentDivs.find("span.pageContentExpand div.arrow");
|
||||
spanArrows.removeClass("collapseArrow");
|
||||
spanArrows.addClass("expandArrow");
|
||||
pageManagementUtils.savedContentDivs.find("div.pageContentContainer div.pageContentWrapper").slideUp(222);
|
||||
},
|
||||
//Clear values in content areas that are cloned to create the page content type specific sections
|
||||
//i.e. reset sparql query/class group areas
|
||||
//TODO: Check if reset is more what we need here?
|
||||
clearSourceTemplateValues:function() {
|
||||
//inputs, textareas
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.fixedHTMLSection);
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.sparqlQuerySection);
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.classGroupSection);
|
||||
pageManagementUtils.clearInputs(pageManagementUtils.searchIndividualsSection);
|
||||
|
||||
},
|
||||
clearInputs:function($el) {
|
||||
// jquery selector :input selects all input text area select and button elements
|
||||
$el.find("input").each( function() {
|
||||
if ( $(this).attr('id') != "doneWithContent" ) {
|
||||
$(this).val("");
|
||||
}
|
||||
});
|
||||
$el.find("textarea").val("");
|
||||
//resetting class group section as well so selection is reset if type changes
|
||||
$el.find("select option:eq(0)").attr("selected", "selected");
|
||||
|
||||
},
|
||||
checkTemplateForMultipleContent:function(contentTypeSelected) {
|
||||
if(contentTypeSelected != "") {
|
||||
var pageContentSections = $("section[class='pageContent']");
|
||||
var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val();
|
||||
//A new section hasn't been added yet so check to see if there is at least one content type already on page
|
||||
if(selectedTemplateValue == "default" && pageContentSections.length >= 1) {
|
||||
//alert the user that they should be picking custom template instead
|
||||
alert(pageManagementUtils.multipleContentWithDefaultTemplateError);
|
||||
//pick custom template
|
||||
$('input:radio[name=selectedTemplate][value="custom"]').attr("checked", true);
|
||||
pageManagementUtils.handleSelectCustomTemplate();
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
//Clone content area
|
||||
//When adding a new content type, this function will copy the values from the new content form and generate
|
||||
//the content for the new section containing the content
|
||||
cloneContentArea: function(contentType, contentTypeLabel) {
|
||||
var ctr = pageManagementUtils.counter;
|
||||
var counter = pageManagementUtils.counter;
|
||||
var varOrClass;
|
||||
|
||||
//Clone the object, renaming ids and copying text area values as well
|
||||
$newContentObj = pageManagementUtils.createCloneObject(contentType, counter);
|
||||
|
||||
// Get rid of the cancel link; it'll be replaced by a delete link
|
||||
$newContentObj.find('span#cancelContent' + counter).html('');
|
||||
|
||||
if ( contentType == "sparqlQuery" || contentType == "fixedHtml" || contentType == "searchIndividuals") {
|
||||
varOrClass = $newContentObj.find('input[name="saveToVar"]').val();
|
||||
}
|
||||
else if ( contentType == "browseClassGroup" ) {
|
||||
$newContentObj.find('section#classesInSelectedGroup' + counter).removeClass('hidden');
|
||||
varOrClass = $newContentObj.find('select#selectClassGroup' + counter + ' option:selected').text();
|
||||
}
|
||||
//For cases where varOrClass might be empty, pass an empty string
|
||||
if(varOrClass == null || varOrClass==undefined) {
|
||||
varOrClass = "";
|
||||
}
|
||||
//Attach event handlers if they exist
|
||||
pageManagementUtils.bindClonedContentEventHandlers($newContentObj);
|
||||
pageManagementUtils.createClonedContentContainer($newContentObj, counter, contentTypeLabel, varOrClass);
|
||||
//previously increased by 10, just increasing by 1 here
|
||||
pageManagementUtils.counter++;
|
||||
},
|
||||
|
||||
//For binding content type specific event handlers should they exist
|
||||
bindClonedContentEventHandlers:function($newContentObj) {
|
||||
var dataGetterProcessorObj = pageManagementUtils.getDataGetterProcessorObject($newContentObj);
|
||||
if($.isFunction(dataGetterProcessorObj.bindEventHandlers)) {
|
||||
dataGetterProcessorObj.bindEventHandlers($newContentObj);
|
||||
}
|
||||
//Bind done event as the done button is within the cloned content
|
||||
pageManagementUtils.bindClonedContentDoneEvent($newContentObj);
|
||||
},
|
||||
createClonedContentContainer:function($newContentObj, counter, contentTypeLabel, varOrClass) {
|
||||
//Create the container for the new content
|
||||
$newDivContainer = $("<div></div>", {
|
||||
id: "divContainer" + counter,
|
||||
"class": "pageContentContainer",
|
||||
html: "<span class='pageContentTypeLabel'>" + contentTypeLabel + " - " + varOrClass
|
||||
+ "</span><span id='clickable" + counter
|
||||
+ "' class='pageContentExpand'><div id='woof' class='arrow expandArrow'></div></span><div id='innerContainer" + counter
|
||||
+ "' class='pageContentWrapper'><span class='deleteLinkContainer'> " + pageManagementUtils.orString + " <a id='remove" + counter // changed button to a link
|
||||
+ "' href='' >" + pageManagementUtils.deleteString + "</a></span></div>"
|
||||
});
|
||||
//Hide inner div
|
||||
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
|
||||
$innerDiv.hide();
|
||||
//Bind event listers for the new content for display/removal etc.
|
||||
pageManagementUtils.bindClonedContentContainerEvents($newDivContainer, counter);
|
||||
//Append the new container to the section storing these containers
|
||||
$newDivContainer.appendTo($('section#contentDivs'));
|
||||
//place new content object
|
||||
$newContentObj.prependTo($innerDiv);
|
||||
},
|
||||
bindClonedContentDoneEvent:function($newContentObj) {
|
||||
//Done button should just collapse the cloned content
|
||||
$newContentObj.find("input[name='doneWithContent']").click(function() {
|
||||
var thisInnerDiv = $(this).closest("div.pageContentWrapper");
|
||||
var thisClickableSpan = thisInnerDiv.prev("span.pageContentExpand");
|
||||
var thisArrowDiv = thisClickableSpan.find('div.arrow');
|
||||
thisInnerDiv.slideUp(222);
|
||||
thisArrowDiv.removeClass("collapseArrow");
|
||||
thisArrowDiv.addClass("expandArrow");
|
||||
window.setTimeout('pageManagementUtils.adjustSaveButtonHeight()', 223);
|
||||
|
||||
});
|
||||
},
|
||||
bindClonedContentContainerEvents:function($newDivContainer, counter) {
|
||||
var $clickableSpan = $newDivContainer.children('span#clickable' + counter);
|
||||
var $innerDiv = $newDivContainer.children('div#innerContainer' + counter);
|
||||
//Expand/collapse toggle
|
||||
$clickableSpan.click(function() {
|
||||
if ( $innerDiv.is(':visible') ) {
|
||||
$innerDiv.slideUp(222);
|
||||
//$clickableSpan.find('img').attr("src","arrow-down.gif");
|
||||
var arrowDiv = $clickableSpan.find('div.arrow');
|
||||
arrowDiv.removeClass("collapseArrow");
|
||||
arrowDiv.addClass("expandArrow");
|
||||
}
|
||||
else {
|
||||
$innerDiv.slideDown(222);
|
||||
//$clickableSpan.find('img').attr("src","arrow-up.gif");
|
||||
var arrowDiv = $clickableSpan.find('div.arrow');
|
||||
arrowDiv.removeClass("expandArrow");
|
||||
arrowDiv.addClass("collapseArrow");
|
||||
}
|
||||
window.setTimeout('pageManagementUtils.adjustSaveButtonHeight()', 223);
|
||||
});
|
||||
|
||||
//remove button
|
||||
$newRemoveLink = $innerDiv.find('a#remove' + counter);
|
||||
//remove the content entirely
|
||||
$newRemoveLink.click(function(event) {
|
||||
//if content type of what is being deleted is browse class group, then
|
||||
//add browse classgroup back to set of options
|
||||
var contentType = $innerDiv.find("section.pageContent").attr("contentType");
|
||||
if(pageManagementUtils.processDataGetterUtils.isRelatedToBrowseClassGroup(contentType)) {
|
||||
pageManagementUtils.handleRemoveBrowseClassGroupPageContent();
|
||||
}
|
||||
//remove the section
|
||||
$innerDiv.parent("div").remove();
|
||||
pageManagementUtils.adjustSaveButtonHeight();
|
||||
pageManagementUtils.checkSelfContainedRadio();
|
||||
//Because this is now a link, have to prevent default action of navigating to link
|
||||
event.preventDefault();
|
||||
});
|
||||
},
|
||||
//clones and returns cloned object for content type
|
||||
createCloneObject:function(contentType, counter) {
|
||||
var originalObjectPath = 'section#' + contentType;
|
||||
var $newContentObj = $(originalObjectPath).clone();
|
||||
$newContentObj.removeClass("contentSectionContainer");
|
||||
$newContentObj.addClass("pageContent");
|
||||
$newContentObj.attr("contentNumber", counter);
|
||||
//Save content type
|
||||
$newContentObj.attr("contentType", contentType);
|
||||
//Set id for object
|
||||
$newContentObj.attr("id", contentType + counter);
|
||||
$newContentObj.show();
|
||||
pageManagementUtils.renameIdsInClone($newContentObj, counter);
|
||||
// pageManagementUtils.cloneTextAreaValues(originalObjectPath, $newContentObj);
|
||||
return $newContentObj;
|
||||
},
|
||||
//This is specifically for cloning text area values
|
||||
//May not need this if implementing the jquery fix
|
||||
///would need a similar function for select as well
|
||||
cloneTextAreaValues:function(originalAncestorPath, $newAncestorObject) {
|
||||
$(originalAncestorPath + " textarea").each(function(index, el) {
|
||||
var originalTextAreaValue = $(this).val();
|
||||
var originalTextAreaName = $(this).attr("name");
|
||||
$newAncestorObject.find("textarea[name='" + originalTextAreaName + "']").val(originalTextAreaValue);
|
||||
});
|
||||
},
|
||||
//given an object and a counter, rename all the ids
|
||||
renameIdsInClone:function($newContentObj, counter) {
|
||||
$newContentObj.find("[id]").each(function(index, el) {
|
||||
var originalId = $(this).attr("id");
|
||||
var newId = originalId + counter;
|
||||
$(this).attr("id", newId);
|
||||
});
|
||||
},
|
||||
/**Existing Content**/
|
||||
//For edit, need to have text passed in
|
||||
//Returns new content object itself
|
||||
cloneContentAreaForEdit: function(contentType, contentTypeLabel, labelText) {
|
||||
var counter = pageManagementUtils.counter;
|
||||
//Clone the object, renaming ids and copying text area values as well
|
||||
$newContentObj = pageManagementUtils.createCloneObject(contentType, counter);
|
||||
//Attach done event
|
||||
//Bind done event as the done button is within the cloned content
|
||||
pageManagementUtils.bindClonedContentDoneEvent($newContentObj);
|
||||
//create cloned content container
|
||||
pageManagementUtils.createClonedContentContainer($newContentObj, counter, contentTypeLabel, labelText);
|
||||
//previously increased by 10, just increasing by 1 here
|
||||
pageManagementUtils.counter++;
|
||||
return $newContentObj;
|
||||
},
|
||||
//To actually generate the content for existing values
|
||||
generateExistingContentSections:function() {
|
||||
if(pageManagementUtils.menuAction == "Edit") {
|
||||
var $existingContent = $("#existingPageContentUnits");
|
||||
//create json object from string version json2.
|
||||
if($existingContent.length > 0) {
|
||||
var jsonObjectString = $existingContent.val();
|
||||
//this returns an array
|
||||
var JSONContentObjectArray = JSON.parse(jsonObjectString);
|
||||
var len = JSONContentObjectArray.length;
|
||||
var i;
|
||||
for(i = 0; i < len; i++) {
|
||||
//Get the type of data getter and create the appropriate section/populate
|
||||
var JSONContentObject = JSONContentObjectArray[i];
|
||||
var dataGetterClass = JSONContentObject["dataGetterClass"];
|
||||
if(dataGetterClass != null) {
|
||||
//Get the Label for the URI
|
||||
var contentType = pageManagementUtils.dataGetterURIToLabel[dataGetterClass];
|
||||
var contentTypeForCloning = pageManagementUtils.processDataGetterUtils.getContentTypeForCloning(contentType);
|
||||
//Get the processor class for this type
|
||||
var dataGetterProcessorObject = pageManagementUtils.processDataGetterUtils.dataGetterProcessorMap[contentType];
|
||||
var contentTypeLabel = dataGetterProcessorObject.retrieveContentLabel();
|
||||
var additionalLabelText = dataGetterProcessorObject.retrieveAdditionalLabelText(JSONContentObject);
|
||||
//Clone the appropriate section for the label
|
||||
var $newContentObj = pageManagementUtils.cloneContentAreaForEdit(contentTypeForCloning, contentTypeLabel, additionalLabelText);
|
||||
//Populate the section with the values
|
||||
dataGetterProcessorObject.populatePageContentSection(JSONContentObject, $newContentObj);
|
||||
//Also include a hidden input with data getter URI
|
||||
pageManagementUtils.includeDataGetterURI(JSONContentObject, $newContentObj);
|
||||
//If content type is browseClassGroup or other 'related types' that are derived from it
|
||||
if(pageManagementUtils.processDataGetterUtils.isRelatedToBrowseClassGroup(contentType)) {
|
||||
pageManagementUtils.handleAddBrowseClassGroupPageContent();
|
||||
}
|
||||
} else {
|
||||
//error condition
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
//What's the label of the content type from the drop down
|
||||
getContentTypeLabelFromSelect:function(contentType) {
|
||||
var text= pageManagementUtils.contentTypeSelect.find("option[value='" + contentType + "']").text();
|
||||
if(text == null) {
|
||||
text = "";
|
||||
}
|
||||
return text;
|
||||
},
|
||||
includeDataGetterURI:function(JSONContentObject, $newContentObj) {
|
||||
var uri = JSONContentObject["URI"];
|
||||
if(uri != null) {
|
||||
$("<input type='hidden' name='URI' value='" + uri + "'>").appendTo($newContentObj);
|
||||
}
|
||||
},
|
||||
|
||||
//Adjust save button height
|
||||
adjustSaveButtonHeight:function() {
|
||||
if ( $("div#leftSide").css("height") != undefined ) {
|
||||
$("div#leftSide").css("height","");
|
||||
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
|
||||
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
|
||||
}
|
||||
}
|
||||
},
|
||||
/***Class group selection***/
|
||||
//Copied from menu management edit javascript
|
||||
//Class group
|
||||
resetClassGroupSection:function() {
|
||||
//doing this in clear inputs instead which will be triggered
|
||||
//every time content type is changed AS well as on more content button after
|
||||
//original content is cloned and stored
|
||||
//$('select#selectClassGroup option').eq(0).attr('selected', 'selected');
|
||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
},
|
||||
chooseClassGroup: function() {
|
||||
var url = "dataservice?getVClassesForVClassGroup=1&classgroupUri=";
|
||||
var vclassUri = this.selectClassGroupDropdown.val();
|
||||
url += encodeURIComponent(vclassUri);
|
||||
//Make ajax call to retrieve vclasses
|
||||
$.getJSON(url, function(results) {
|
||||
//Moved the function to processClassGroupDataGetterContent
|
||||
//Should probably remove this entire method and copy there
|
||||
pageManagementUtils.displayClassesForClassGroup(results);
|
||||
});
|
||||
},
|
||||
displayClassesForClassGroup:function(results) {
|
||||
if ( results.classes.length == 0 ) {
|
||||
|
||||
} else {
|
||||
//update existing content type with correct class group name and hide class group select again
|
||||
// pageManagementUtils.hideClassGroups();
|
||||
|
||||
pageManagementUtils.selectedGroupForPage.html(results.classGroupName);
|
||||
//update content type in message to "display x within my institution"
|
||||
//SPECIFIC TO VIVO: So include in internal CLASS section instead
|
||||
pageManagementUtils.updateInternalClassMessage(results.classGroupName);
|
||||
//retrieve classes for class group and display with all selected
|
||||
var selectedClassesList = pageManagementUtils.classesForClassGroup.children('ul#selectedClasses');
|
||||
|
||||
selectedClassesList.empty();
|
||||
selectedClassesList.append('<li class="ui-state-default"> <input type="checkbox" name="allSelected" id="allSelected" value="all" checked="checked" /> <label class="inline" for="All"> ' + pageManagementUtils.allCapitalized + '</label> </li>');
|
||||
|
||||
$.each(results.classes, function(i, item) {
|
||||
var thisClass = results.classes[i];
|
||||
var thisClassName = thisClass.name;
|
||||
//For the class group, ALL classes should be selected
|
||||
appendHtml = ' <li class="ui-state-default">' +
|
||||
'<input type="checkbox" checked="checked" name="classInClassGroup" value="' + thisClass.URI + '" />' +
|
||||
'<label class="inline" for="' + thisClassName + '"> ' + thisClassName + '</label>' +
|
||||
'</li>';
|
||||
selectedClassesList.append(appendHtml);
|
||||
});
|
||||
pageManagementUtils.toggleClassSelection();
|
||||
|
||||
|
||||
//From NEW code
|
||||
if (pageManagementUtils.selectClassGroupDropdown.val() == "" ) {
|
||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||
$("div#leftSide").css("height","");
|
||||
|
||||
}
|
||||
else {
|
||||
pageManagementUtils.classesForClassGroup.removeClass('hidden');
|
||||
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
|
||||
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
toggleClassSelection: function() {
|
||||
// Check/unckeck all classes for selection
|
||||
$('input:checkbox[name=allSelected]').click(function(){
|
||||
if ( this.checked ) {
|
||||
// if checked, select all the checkboxes for this particular section
|
||||
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').attr('checked','checked');
|
||||
//$('input:checkbox[name=classInClassGroup]').attr('checked','checked');
|
||||
|
||||
} else {
|
||||
// if not checked, deselect all the checkboxes
|
||||
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').removeAttr('checked');
|
||||
|
||||
// $('input:checkbox[name=classInClassGroup]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
$('input:checkbox[name=classInClassGroup]').click(function(){
|
||||
$(this).closest("ul").find('input:checkbox[name=allSelected]').removeAttr('checked');
|
||||
});
|
||||
}, //This is SPECIFIC to VIVO so should be moved there
|
||||
updateInternalClassMessage:function(classGroupName) { //User has changed content type
|
||||
//Set content type within internal class message
|
||||
this.displayInternalMessage.filter(":first").html(classGroupName);
|
||||
},
|
||||
|
||||
/**On submission**/
|
||||
//On submission, generates the content for the input that will return the serialized JSON objects representing
|
||||
//each of the content types
|
||||
createPageContentForSubmission: function() {
|
||||
//Iterate through the page content and create the appropriate json object and save
|
||||
var pageContentSections = $("section[class='pageContent']");
|
||||
$.each(pageContentSections, function(i) {
|
||||
var id = $(this).attr("id");
|
||||
var jo = pageManagementUtils.processPageContentSection($(this));
|
||||
var jsonObjectString = JSON.stringify(jo);
|
||||
//Create a new hidden input with a specific name and assign value per page content
|
||||
pageManagementUtils.createPageContentInputForSubmission(jsonObjectString);
|
||||
});
|
||||
//For the case where the template only selection is picked, there will be
|
||||
//no page contents, but the hidden input still needs to be created as it is expected
|
||||
//to exist by the edit configuration, this creates the hidden input with an empty value
|
||||
if (pageManagementUtils.isSelfContainedTemplateChecked() ) {
|
||||
//An empty string as no content selected
|
||||
pageManagementUtils.createPageContentInputForSubmission("");
|
||||
}
|
||||
},
|
||||
createPageContentInputForSubmission: function(inputValue) {
|
||||
//Previously, this code created the hidden input and included the value inline
|
||||
//but this was converting html encoding for quotes/single quotes into actual quotes
|
||||
//which prevented correct processing as the html thought the string had ended
|
||||
//Creating the input and then using the val() method preserved the encoding
|
||||
var pageContentUnit = $("<input type='hidden' name='pageContentUnit'>");
|
||||
pageContentUnit.val(inputValue);
|
||||
pageContentUnit.appendTo(pageManagementUtils.pageContentSubmissionInputs);
|
||||
},
|
||||
//returns a json object with the data getter information required
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
//This processing should be specific to the type and so that content type's specific processor will
|
||||
//return the json object required
|
||||
if(pageManagementUtils.processDataGetterUtils != null) {
|
||||
var dataGetterType = pageManagementUtils.processDataGetterUtils.selectDataGetterType(pageContentSection);
|
||||
if(pageManagementUtils.dataGetterProcessorMap != null) {
|
||||
var dataGetterProcessor = pageManagementUtils.dataGetterProcessorMap[dataGetterType];
|
||||
//the content type specific processor will create the json object to be returned
|
||||
var jsonObject = dataGetterProcessor.processPageContentSection(pageContentSection);
|
||||
//if data getter uri included, include that as well
|
||||
if(pageContentSection.find("input[name='URI']").length > 0) {
|
||||
var uriValue = pageContentSection.find("input[name='URI']").val();
|
||||
jsonObject["URI"] = uriValue;
|
||||
}
|
||||
return jsonObject;
|
||||
} else {
|
||||
//ERROR handling
|
||||
alert(pageManagementUtils.mapProcessorError);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
alert(pageManagementUtils.codeProcessingError);
|
||||
//Error handling here
|
||||
return null;
|
||||
},
|
||||
|
||||
//Get the data getter processor
|
||||
getDataGetterProcessorObject:function(pageContentSection) {
|
||||
var dataGetterType = pageManagementUtils.processDataGetterUtils.selectDataGetterType(pageContentSection);
|
||||
var dataGetterProcessor = null;
|
||||
if(pageManagementUtils.dataGetterProcessorMap != null) {
|
||||
dataGetterProcessor = pageManagementUtils.dataGetterProcessorMap[dataGetterType];
|
||||
}
|
||||
return dataGetterProcessor;
|
||||
},
|
||||
handleAddBrowseClassGroupPageContent:function() {
|
||||
//if browse class group content has been added, then remove browse classgroup option from dropdown
|
||||
if(pageManagementUtils.contentTypeSelect.find("option[value='browseClassGroup']").length > 0) {
|
||||
pageManagementUtils.contentTypeSelect.find("option[value='browseClassGroup']").remove();
|
||||
}
|
||||
},
|
||||
handleRemoveBrowseClassGroupPageContent:function() {
|
||||
if(pageManagementUtils.contentTypeSelect.find("option[value='browseClassGroup']").length == 0) {
|
||||
//if removed, add browse class group back
|
||||
var classGroupOption = '<option value="browseClassGroup">Browse Class Group</option>';
|
||||
pageManagementUtils.contentTypeSelect.find('option:eq(0)').after(classGroupOption);
|
||||
}
|
||||
},
|
||||
//get label of page content section
|
||||
getPageContentSectionLabel:function(pageContentSection) {
|
||||
var label = pageContentSection.closest("div.pageContentContainer").find("span.pageContentTypeLabel").html();
|
||||
if(label == null) {
|
||||
label = "";
|
||||
}
|
||||
return label;
|
||||
},
|
||||
/***Validation***/
|
||||
validateMenuItemForm: function() {
|
||||
var validationError = "";
|
||||
|
||||
// Check menu name
|
||||
if ($('input[type=text][name=pageName]').val() == "") {
|
||||
validationError += pageManagementUtils.supplyName + "<br />";
|
||||
}
|
||||
// Check pretty url
|
||||
if ($('input[type=text][name=prettyUrl]').val() == "") {
|
||||
validationError += pageManagementUtils.supplyPrettyUrl + "<br />";
|
||||
}
|
||||
if ($('input[type=text][name=prettyUrl]').val().charAt(0) != "/") {
|
||||
validationError += pageManagementUtils.startUrlWithSlash + "<br />";
|
||||
}
|
||||
|
||||
// Check custom template and self contained template
|
||||
var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val();
|
||||
if (selectedTemplateValue == "custom" || selectedTemplateValue == "selfContained") {
|
||||
if ($('input[name=customTemplate]').val() == "") {
|
||||
validationError += pageManagementUtils.supplyTemplate + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return validationError;
|
||||
},
|
||||
//Validation across different content types
|
||||
validatePageContentSections:function() {
|
||||
//Get all page content sections
|
||||
var pageContentSections = $("section[class='pageContent']");
|
||||
var validationErrorMsg = "";
|
||||
//If there ARE not contents selected, then error message should indicate user needs to add them
|
||||
if(pageContentSections.length == 0) {
|
||||
validationErrorMsg = pageManagementUtils.selectContentType + " <br /> ";
|
||||
} else {
|
||||
//If there are multiple content types, and the default template option is selected, then display error message
|
||||
if(pageContentSections.length > 1) {
|
||||
var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val();
|
||||
if(selectedTemplateValue == "default") {
|
||||
validationErrorMsg += pageManagementUtils.multipleContentWithDefaultTemplateError + "<br/>";
|
||||
}
|
||||
}
|
||||
//For each, based on type, validate if a validation function exists
|
||||
$.each(pageContentSections, function(i) {
|
||||
if(pageManagementUtils.processDataGetterUtils != null) {
|
||||
var dataGetterType = pageManagementUtils.processDataGetterUtils.selectDataGetterType($(this));
|
||||
if(pageManagementUtils.dataGetterProcessorMap != null) {
|
||||
var dataGetterProcessor = pageManagementUtils.dataGetterProcessorMap[dataGetterType];
|
||||
//the content type specific processor will create the json object to be returned
|
||||
if($.isFunction(dataGetterProcessor.validateFormSubmission)) {
|
||||
//Get label of page content section
|
||||
var label = pageManagementUtils.getPageContentSectionLabel($(this));
|
||||
validationErrorMsg += dataGetterProcessor.validateFormSubmission($(this), label);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return validationErrorMsg;
|
||||
},
|
||||
|
||||
//If the selfContained-template radio is checked, copy the custom template name to the hidden
|
||||
//selfContainedTemplate input element. We need that for edit mode to select the correct radio button.
|
||||
mapCustomTemplateName:function() {
|
||||
if ( pageManagementUtils.selfContainedTemplateRadio.is(':checked') ) {
|
||||
$("input[name='selfContainedTemplate']").val($("input[name='customTemplate']").val());
|
||||
}
|
||||
},
|
||||
|
||||
setUsesSelfContainedTemplateInput:function() {
|
||||
//On form submission attach hidden input to form if the custom template selection is picked
|
||||
if ( pageManagementUtils.isSelfContainedTemplateChecked() ) {
|
||||
$("<input name='isSelfContainedTemplate' value='true'>").appendTo($("form"));
|
||||
}
|
||||
},
|
||||
|
||||
//If any content is defined, keep the selContained radio button hidden
|
||||
checkSelfContainedRadio:function() {
|
||||
if ( pageManagementUtils.savedContentDivs.html().length == 0 ) {
|
||||
$('div#selfContainedDiv').show();
|
||||
}
|
||||
|
||||
},
|
||||
isSelfContainedTemplateChecked:function() {
|
||||
return pageManagementUtils.selfContainedTemplateRadio.is(':checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
pageManagementUtils.onLoad();
|
||||
});
|
||||
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStringsBrowseGroups);
|
||||
//Process sparql data getter and provide a json object with the necessary information
|
||||
//Depending on what is included here, a different type of data getter might be used
|
||||
var processClassGroupDataGetterContent = {
|
||||
dataGetterClass:null,
|
||||
//can use this if expect to initialize from elsewhere
|
||||
initProcessor:function(dataGetterClassInput) {
|
||||
this.dataGetterClass = dataGetterClassInput;
|
||||
},
|
||||
|
||||
//Do we need a separate content type for each of the others?
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
//Will look at classes etc.
|
||||
var classGroup = pageContentSection.find("select[name='selectClassGroup']").val();
|
||||
//query model should also be an input, ensure class group URI is saved as URI and not string
|
||||
var returnObject = {classGroup:classGroup, dataGetterClass:this.dataGetterClass};
|
||||
return returnObject;
|
||||
},
|
||||
//For an existing set of content where form is already set, fill in the values
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
var classGroupValue = existingContentObject["classGroup"];
|
||||
pageContentSection.find("select[name='selectClassGroup']").val(classGroupValue);
|
||||
//For now, will utilize the function in pageManagementUtils
|
||||
//But should move over any class group specific event handlers etc. into this javascript section
|
||||
//Get 'results' from content object
|
||||
var results = existingContentObject["results"];
|
||||
if(results != null) {
|
||||
processClassGroupDataGetterContent.displayClassesForClassGroup(results, pageContentSection);
|
||||
//Bind event handlers
|
||||
processClassGroupDataGetterContent.bindEventHandlers(pageContentSection);
|
||||
//Show hidden class
|
||||
}
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveContentLabel:function() {
|
||||
return i18nStringsBrowseGroups.browseClassGroup;
|
||||
},
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
var label = "";
|
||||
var results = existingContentObject["results"];
|
||||
if(results != null && results["classGroupName"] != null) {
|
||||
label = results["classGroupName"];
|
||||
}
|
||||
return label;
|
||||
},
|
||||
//this is copied from pageManagementUtils but eventually
|
||||
//we should move all event bindings etc. specific to a content type into its own
|
||||
//processing methods
|
||||
//TODO: Refine so no references to pageManagementUtils required
|
||||
//Page content section specific methods
|
||||
displayClassesForClassGroup:function(results, pageContentSection) {
|
||||
if ( results.classes.length == 0 ) {
|
||||
|
||||
} else {
|
||||
var contentNumber = pageContentSection.attr("contentNumber");
|
||||
var classesForClassGroup = pageContentSection.find('section[name="classesInSelectedGroup"]');
|
||||
|
||||
//retrieve classes for class group and display with all selected
|
||||
var selectedClassesList = classesForClassGroup.children('ul[name="selectedClasses"]');
|
||||
|
||||
selectedClassesList.empty();
|
||||
var newId = "allSelected" + contentNumber;
|
||||
selectedClassesList.append('<li class="ui-state-default"> <input type="checkbox" name="allSelected" id="' + contentNumber + '" value="all" checked="checked" /> <label class="inline" for="All"> ' + i18nStringsBrowseGroups.allCapitalized + '</label> </li>');
|
||||
|
||||
$.each(results.classes, function(i, item) {
|
||||
var thisClass = results.classes[i];
|
||||
var thisClassName = thisClass.name;
|
||||
//For the class group, ALL classes should be selected
|
||||
appendHtml = ' <li class="ui-state-default">' +
|
||||
'<input type="checkbox" checked="checked" name="classInClassGroup" value="' + thisClass.URI + '" />' +
|
||||
'<label class="inline" for="' + thisClassName + '"> ' + thisClassName + '</label>' +
|
||||
'</li>';
|
||||
selectedClassesList.append(appendHtml);
|
||||
});
|
||||
|
||||
//Need a way of handling this without it being in the internal class data getter
|
||||
var displayInternalMessage = pageContentSection.find('label[for="display-internalClass"] em');
|
||||
if(displayInternalMessage != null) {
|
||||
displayInternalMessage.filter(":first").html(results.classGroupName);
|
||||
}
|
||||
//This is an EXISTING selection, so value should not be empty
|
||||
classesForClassGroup.removeClass('hidden');
|
||||
if ( $("div#leftSide").height() < $("div#rightSide").height() ) {
|
||||
$("div#leftSide").css("height",$("div#rightSide").height() + "px");
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
//Toggle class selection already deals with names but want to attach that event
|
||||
//handler to THIS new section
|
||||
toggleClassSelection: function(pageContentSection) {
|
||||
// Check/unckeck all classes for selection
|
||||
pageContentSection.find('input:checkbox[name=allSelected]').click(function(){
|
||||
if ( this.checked ) {
|
||||
// if checked, select all the checkboxes for this particular section
|
||||
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').attr('checked','checked');
|
||||
//$('input:checkbox[name=classInClassGroup]').attr('checked','checked');
|
||||
|
||||
} else {
|
||||
// if not checked, deselect all the checkboxes
|
||||
$(this).closest("ul").find('input:checkbox[name=classInClassGroup]').removeAttr('checked');
|
||||
|
||||
// $('input:checkbox[name=classInClassGroup]').removeAttr('checked');
|
||||
}
|
||||
});
|
||||
|
||||
pageContentSection.find('input:checkbox[name=classInClassGroup]').click(function(){
|
||||
$(this).closest("ul").find('input:checkbox[name=allSelected]').removeAttr('checked');
|
||||
});
|
||||
},
|
||||
bindEventHandlers:function(pageContentSection) {
|
||||
processClassGroupDataGetterContent.toggleClassSelection(pageContentSection);
|
||||
|
||||
var selectClassGroupDropdown = pageContentSection.find("select[name='selectClassGroup']");
|
||||
selectClassGroupDropdown.change(function(e, el) {
|
||||
processClassGroupDataGetterContent.chooseClassGroup(pageContentSection);
|
||||
});
|
||||
},
|
||||
chooseClassGroup: function(pageContentSection) {
|
||||
var selectClassGroupDropdown = pageContentSection.find("select[name='selectClassGroup']");
|
||||
var url = "dataservice?getVClassesForVClassGroup=1&classgroupUri=";
|
||||
var vclassUri = selectClassGroupDropdown.val();
|
||||
url += encodeURIComponent(vclassUri);
|
||||
//Get the page content section
|
||||
//Make ajax call to retrieve vclasses
|
||||
$.getJSON(url, function(results) {
|
||||
//Moved the function to processClassGroupDataGetterContent
|
||||
//Should probably remove this entire method and copy there
|
||||
processClassGroupDataGetterContent.displayClassesForClassGroup(results, pageContentSection);
|
||||
});
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
var validationError = "";
|
||||
if (pageContentSection.find('select[name="selectClassGroup"]').val() =='-1') {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsBrowseGroups.supplyClassGroup + " <br />";
|
||||
} else {
|
||||
//class group has been selected, make sure there is at least one class selected
|
||||
var allSelected = pageContentSection.find('input[name="allSelected"]:checked').length;
|
||||
var noClassesSelected = pageContentSection.find('input[name="classInClassGroup"]:checked').length;
|
||||
if (allSelected == 0 && noClassesSelected == 0) {
|
||||
//at least one class should be selected
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsBrowseGroups.selectClasses + "<br />";
|
||||
}
|
||||
}
|
||||
return validationError;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
//This class is responsible for the product-specific form processing/content selection that might be possible
|
||||
//Overrides the usual behavior of selecting the specific JavaScript class needed to convert the form inputs
|
||||
//into a JSON object for submission based on the page content type
|
||||
|
||||
//This will need to be overridden or extended, what have you.. in VIVO
|
||||
var processDataGetterUtils = {
|
||||
dataGetterProcessorMap:{"browseClassGroup": processClassGroupDataGetterContent,
|
||||
"sparqlQuery": processSparqlDataGetterContent,
|
||||
"fixedHtml":processFixedHTMLDataGetterContent,
|
||||
"individualsForClasses":processIndividualsForClassesDataGetterContent,
|
||||
"searchIndividuals":processSearchDataGetterContent},
|
||||
selectDataGetterType:function(pageContentSection) {
|
||||
var contentType = pageContentSection.attr("contentType");
|
||||
//The form can provide "browse class group" as content type but need to check
|
||||
//whether this is in fact individuals for classes instead
|
||||
if(contentType == "browseClassGroup") {
|
||||
//Is ALL NOT selected and there are other classes, pick one
|
||||
//this SHOULD be an array
|
||||
var allClassesSelected = pageContentSection.find("input[name='allSelected']:checked");
|
||||
//If all NOT selected then need to pick a different content type
|
||||
if(allClassesSelected.length == 0) {
|
||||
contentType = "individualsForClasses";
|
||||
}
|
||||
}
|
||||
|
||||
return contentType;
|
||||
},
|
||||
isRelatedToBrowseClassGroup:function(contentType) {
|
||||
return (contentType == "browseClassGroup" || contentType == "individualsForClasses");
|
||||
},
|
||||
getContentTypeForCloning:function(contentType) {
|
||||
if(contentType == "browseClassGroup" || contentType == "individualsForClasses") {
|
||||
return "browseClassGroup";
|
||||
}
|
||||
return contentType;
|
||||
}
|
||||
};
|
|
@ -1,77 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStringsFixedHtml);
|
||||
//Process sparql data getter and provide a json object with the necessary information
|
||||
var processFixedHTMLDataGetterContent = {
|
||||
dataGetterClass:null,
|
||||
//can use this if expect to initialize from elsewhere
|
||||
initProcessor:function(dataGetterClass) {
|
||||
this.dataGetterClass =dataGetterClass;
|
||||
},
|
||||
//requires variable and text area
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
var saveToVarValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
var htmlValue = pageContentSection.find("textarea[name='htmlValue']").val();
|
||||
//JSON parsing on the server side does not handle single quotes, as it appears it thinks the string has
|
||||
//ended. Different data getter types may handle apostrophes/single quotes differently
|
||||
//In this case, this is HTML so it simply html Encodes any apostrophes
|
||||
htmlValue = processFixedHTMLDataGetterContent.encodeQuotes(htmlValue);
|
||||
var returnObject = {saveToVar:saveToVarValue, htmlValue:htmlValue, dataGetterClass:this.dataGetterClass};
|
||||
return returnObject;
|
||||
},
|
||||
//For an existing set of content where form is already set, fill in the values
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
var htmlValue = existingContentObject["htmlValue"];
|
||||
//In displaying the html value for the edit field, replace the encoded quotes with regular quotes
|
||||
htmlValue = processFixedHTMLDataGetterContent.replaceEncodedWithEscapedQuotes(htmlValue);
|
||||
//Now find and set value
|
||||
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
|
||||
pageContentSection.find("textarea[name='htmlValue']").val(htmlValue);
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveContentLabel:function() {
|
||||
return i18nStringsFixedHtml.fixedHtml;
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
return saveToVarValue;
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
var validationError = "";
|
||||
//Check that query and saveToVar have been input
|
||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
if(variableValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.supplyVariableName + " <br />";
|
||||
}
|
||||
if(processFixedHTMLDataGetterContent.stringHasSingleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.noApostrophes + " <br />";
|
||||
}
|
||||
if(processFixedHTMLDataGetterContent.stringHasDoubleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.noDoubleQuotes + " <br />";
|
||||
}
|
||||
var htmlValue = pageContentSection.find("textarea[name='htmlValue']").val();
|
||||
if(htmlValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsFixedHtml.supplyHtml + " <br />";
|
||||
}
|
||||
return validationError;
|
||||
},
|
||||
encodeQuotes:function(inputStr) {
|
||||
return inputStr.replace(/'/g, ''').replace(/"/g, '"');
|
||||
},
|
||||
//For the variable name, no single quote should be allowed
|
||||
//This can be extended for other special characters
|
||||
stringHasSingleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("'") != -1);
|
||||
},
|
||||
stringHasDoubleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("\"") != -1);
|
||||
},
|
||||
replaceEncodedWithEscapedQuotes: function(inputStr) {
|
||||
return inputStr.replace(/'/g, "\'").replace(/"/g, "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var processIndividualsForClassesDataGetterContent = {
|
||||
dataGetterClass:null,
|
||||
//can use this if expect to initialize from elsewhere
|
||||
initProcessor:function(dataGetterClassInput) {
|
||||
this.dataGetterClass = dataGetterClassInput;
|
||||
},
|
||||
//Do we need a separate content type for each of the others?
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
//Will look at classes etc.
|
||||
var classGroup = pageContentSection.find("select[name='selectClassGroup']").val();
|
||||
//query model should also be an input
|
||||
//Get classes selected
|
||||
var classesSelected = [];
|
||||
pageContentSection.find("input[name='classInClassGroup']:checked").each(function(){
|
||||
//Need to make sure that the class is also saved as a URI
|
||||
classesSelected.push($(this).val());
|
||||
});
|
||||
var returnObject = {classGroup:classGroup, classesSelectedInClassGroup:classesSelected, dataGetterClass:this.dataGetterClass};
|
||||
return returnObject;
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveContentLabel:function() {
|
||||
return processClassGroupDataGetterContent.retrieveContentLabel();
|
||||
},
|
||||
//For an existing set of content where form is already set, fill in the values
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
//select class group in dropdown and append the classes within that class group
|
||||
processClassGroupDataGetterContent.populatePageContentSection(existingContentObject, pageContentSection);
|
||||
var classesSelected = existingContentObject["classesSelectedInClassGroup"];
|
||||
var numberSelected = classesSelected.length;
|
||||
var i;
|
||||
//Uncheck all since default is checked
|
||||
pageContentSection.find("input[name='classInClassGroup']").removeAttr("checked");
|
||||
for(i = 0; i < numberSelected; i++) {
|
||||
var classSelected = classesSelected[i];
|
||||
pageContentSection.find("input[name='classInClassGroup'][value='" + classSelected + "']").attr("checked", "checked");
|
||||
}
|
||||
//If number of classes selected is not equal to total number of classes, uncheck all
|
||||
|
||||
var results =existingContentObject["results"];
|
||||
if(results != null && results.classGroupName != null) {
|
||||
var resultsClasses = results["classes"];
|
||||
if(resultsClasses != null) {
|
||||
var numberClasses = resultsClasses.length;
|
||||
if(numberClasses != numberSelected) {
|
||||
pageContentSection.find("input[name='allSelected']").removeAttr("checked");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
return processClassGroupDataGetterContent.retrieveAdditionalLabelText(existingContentObject);
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
return processClassGroupDataGetterContent.validateFormSubmission(pageContentSection, pageContentSectionLabel);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStringsSearchIndividuals);
|
||||
|
||||
//Process sparql data getter and provide a json object with the necessary information
|
||||
var processSearchDataGetterContent = {
|
||||
dataGetterClass:null,
|
||||
//can use this if expect to initialize from elsewhere
|
||||
initProcessor:function(dataGetterClass) {
|
||||
this.dataGetterClass =dataGetterClass;
|
||||
|
||||
},
|
||||
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
|
||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
var vclassUriValue = pageContentSection.find("select[name='vclassUri']").val();
|
||||
|
||||
|
||||
//query model should also be an input
|
||||
//set query model to query model here - vitro:contentDisplayModel
|
||||
var returnObject = {saveToVar:variableValue, vclassUri:vclassUriValue, dataGetterClass:this.dataGetterClass};
|
||||
return returnObject;
|
||||
},
|
||||
//For an existing set of content where form is already set, fill in the values
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
var vclassUriValue = existingContentObject["vclassUri"];
|
||||
|
||||
|
||||
//Now find and set value
|
||||
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
|
||||
//set value of query
|
||||
pageContentSection.find("select[name='vclassUri']").val(vclassUriValue);
|
||||
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveContentLabel:function() {
|
||||
return i18nStringsSearchIndividuals.searchIndividuals;
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
return saveToVarValue;
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
var validationError = "";
|
||||
//Check that vclassuri and saveToVar have been input
|
||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
if(variableValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.supplyQueryVariable + " <br />"
|
||||
}
|
||||
if(processSearchDataGetterContent.stringHasSingleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noApostrophes + " <br />";
|
||||
}
|
||||
if(processSearchDataGetterContent.stringHasDoubleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noDoubleQuotes + " <br />";
|
||||
}
|
||||
|
||||
//validation for search individuals
|
||||
|
||||
var vclassUriValue = pageContentSection.find("select[name='vclassUri']").val();
|
||||
if(vclassUriValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.selectClass + " <br />";
|
||||
}
|
||||
return validationError;
|
||||
},
|
||||
encodeQuotes:function(inputStr) {
|
||||
return inputStr.replace(/'/g, ''').replace(/"/g, '"');
|
||||
},
|
||||
//For the variable name, no single quote should be allowed
|
||||
//This can be extended for other special characters
|
||||
stringHasSingleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("'") != -1);
|
||||
},
|
||||
stringHasDoubleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("\"") != -1);
|
||||
},
|
||||
replaceEncodedWithEscapedQuotes: function(inputStr) {
|
||||
|
||||
return inputStr.replace(/'/g, "\'").replace(/"/g, "\"");
|
||||
}
|
||||
|
||||
|
||||
};
|
|
@ -1,97 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStringsSparqlQuery);
|
||||
|
||||
//Process sparql data getter and provide a json object with the necessary information
|
||||
var processSparqlDataGetterContent = {
|
||||
dataGetterClass:null,
|
||||
//can use this if expect to initialize from elsewhere
|
||||
initProcessor:function(dataGetterClass) {
|
||||
this.dataGetterClass =dataGetterClass;
|
||||
},
|
||||
processPageContentSection:function(pageContentSection) {
|
||||
|
||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
var queryValue = pageContentSection.find("textarea[name='query']").val();
|
||||
queryValue = processSparqlDataGetterContent.encodeQuotes(queryValue);
|
||||
var queryModel = pageContentSection.find("input[name='queryModel']").val();
|
||||
|
||||
//query model should also be an input
|
||||
//set query model to query model here - vitro:contentDisplayModel
|
||||
var returnObject = {saveToVar:variableValue, query:queryValue, dataGetterClass:this.dataGetterClass, queryModel:queryModel};
|
||||
return returnObject;
|
||||
},
|
||||
//For an existing set of content where form is already set, fill in the values
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
var queryValue = existingContentObject["query"];
|
||||
//replace any encoded quotes with escaped quotes that will show up as quotes in the textarea
|
||||
queryValue = processSparqlDataGetterContent.replaceEncodedWithEscapedQuotes(queryValue);
|
||||
var queryModelValue = existingContentObject["queryModel"];
|
||||
|
||||
|
||||
//Now find and set value
|
||||
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
|
||||
pageContentSection.find("textarea[name='query']").val(queryValue);
|
||||
pageContentSection.find("input[name='queryModel']").val(queryModelValue);
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveContentLabel:function() {
|
||||
return i18nStringsSparqlQuery.sparqlResults;
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
var saveToVarValue = existingContentObject["saveToVar"];
|
||||
return saveToVarValue;
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
var validationError = "";
|
||||
//Check that query and saveToVar have been input
|
||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||
if(variableValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.supplyQueryVariable + " <br />"
|
||||
}
|
||||
if(processSparqlDataGetterContent.stringHasSingleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.noApostrophes + " <br />";
|
||||
}
|
||||
if(processSparqlDataGetterContent.stringHasDoubleQuote(variableValue)) {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.noDoubleQuotes + " <br />";
|
||||
}
|
||||
//Check that query model does not have single or double quotes within it
|
||||
//Uncomment this/adapt this when we actually allow display the query model input
|
||||
/*
|
||||
var queryModelValue = pageContentSection.find("input[name='queryModel']").val();
|
||||
if(processSparqlDataGetterContent.stringHasSingleQuote(queryModelValue)) {
|
||||
validationError += pageContentSectionLabel + ": The query model should not have an apostrophe . <br />";
|
||||
|
||||
}
|
||||
if(processSparqlDataGetterContent.stringHasDoubleQuote(queryModelValue)) {
|
||||
validationError += pageContentSectionLabel + ": The query model should not have a double quote . <br />";
|
||||
|
||||
}*/
|
||||
|
||||
var queryValue = pageContentSection.find("textarea[name='query']").val();
|
||||
if(queryValue == "") {
|
||||
validationError += pageContentSectionLabel + ": " + i18nStringsSparqlQuery.supplyQuery + " <br />";
|
||||
}
|
||||
return validationError;
|
||||
},
|
||||
encodeQuotes:function(inputStr) {
|
||||
return inputStr.replace(/'/g, ''').replace(/"/g, '"');
|
||||
},
|
||||
//For the variable name, no single quote should be allowed
|
||||
//This can be extended for other special characters
|
||||
stringHasSingleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("'") != -1);
|
||||
},
|
||||
stringHasDoubleQuote:function(inputStr) {
|
||||
return(inputStr.indexOf("\"") != -1);
|
||||
},
|
||||
replaceEncodedWithEscapedQuotes: function(inputStr) {
|
||||
|
||||
return inputStr.replace(/'/g, "\'").replace(/"/g, "\"");
|
||||
}
|
||||
|
||||
|
||||
};
|
|
@ -1,577 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/*
|
||||
ORNG Shindig Helper functions for gadget-to-container commands
|
||||
*/
|
||||
|
||||
// dummy function so google analytics does not break for institutions who do not use it
|
||||
|
||||
_gaq = {};
|
||||
_gaq.push = function(data) { //
|
||||
};
|
||||
|
||||
// pubsub
|
||||
gadgets.pubsubrouter.init(function(id) {
|
||||
return my.gadgets[shindig.container.gadgetService.getGadgetIdFromModuleId(id)].url;
|
||||
}, {
|
||||
onSubscribe: function(sender, channel) {
|
||||
setTimeout("my.onSubscribe('" + sender + "', '" + channel + "')", 3000);
|
||||
// return true to reject the request.
|
||||
return false;
|
||||
},
|
||||
onUnsubscribe: function(sender, channel) {
|
||||
//alert(sender + " unsubscribes from channel '" + channel + "'");
|
||||
// return true to reject the request.
|
||||
return false;
|
||||
},
|
||||
onPublish: function(sender, channel, message) {
|
||||
// return true to reject the request.
|
||||
|
||||
// track with google analytics
|
||||
if (sender != '..' ) {
|
||||
var moduleId = shindig.container.gadgetService.getGadgetIdFromModuleId(sender);
|
||||
}
|
||||
|
||||
if (channel == 'VISIBLE') {
|
||||
var statusId = document.getElementById(sender + '_status');
|
||||
if (statusId) {
|
||||
// only act on these in HOME view since they are only meant to be seen when viewer=owner
|
||||
if (my.gadgets[moduleId].view != 'home') {
|
||||
return true;
|
||||
}
|
||||
if (message == 'Y') {
|
||||
/* statusId.style.color = 'GREEN';
|
||||
statusId.innerHTML = 'This section is VISIBLE';
|
||||
if (my.gadgets[moduleId].visible_scope == 'U') {
|
||||
statusId.innerHTML += ' to UCSF';
|
||||
}
|
||||
else {
|
||||
statusId.innerHTML += ' to the public';
|
||||
}
|
||||
*/
|
||||
/* changed the gui here -- tlw72 */
|
||||
statusId.style.color = '#5e6363';
|
||||
statusId.innerHTML = 'public';
|
||||
}
|
||||
else {
|
||||
/* statusId.style.color = '#CC0000';
|
||||
statusId.innerHTML = 'This section is HIDDEN';
|
||||
if (my.gadgets[moduleId].visible_scope == 'U') {
|
||||
statusId.innerHTML += ' from UCSF';
|
||||
}
|
||||
else {
|
||||
statusId.innerHTML += ' from the public';
|
||||
}
|
||||
*/
|
||||
/* changed the gui here -- tlw72 */
|
||||
statusId.style.color = '#5e6363';
|
||||
statusId.innerHTML = 'private';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (channel == 'added' && my.gadgets[moduleId].view == 'home') {
|
||||
if (message == 'Y') {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'SHOW', 'profile_edit_view']);
|
||||
// find out whose page we are on, if any
|
||||
var userId = gadgets.util.getUrlParameters()['uri'] || document.URL.replace('/display/', '/individual/');
|
||||
osapi.activities.create(
|
||||
{ 'userId': userId,
|
||||
'appId': my.gadgets[moduleId].appId,
|
||||
'activity': {'postedTime': new Date().getTime(), 'title': 'added a gadget', 'body': 'added the ' + my.gadgets[moduleId].name + ' gadget to their profile' }
|
||||
}).execute(function(response){});
|
||||
}
|
||||
else {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'HIDE', 'profile_edit_view']);
|
||||
}
|
||||
}
|
||||
else if (channel == 'status') {
|
||||
// message should be of the form 'COLOR:Message Content'
|
||||
var statusId = document.getElementById(sender + '_status');
|
||||
if (statusId) {
|
||||
var messageSplit = message.split(':');
|
||||
if (messageSplit.length == 2) {
|
||||
statusId.style.color = messageSplit[0];
|
||||
statusId.innerHTML = messageSplit[1];
|
||||
}
|
||||
else {
|
||||
statusId.innerHTML = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (channel == 'analytics') {
|
||||
// publish to google analytics
|
||||
// message should be JSON encoding object with required action and optional label and value
|
||||
// as documented here: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
|
||||
// note that event category will be set to the gadget name automatically by this code
|
||||
// Note: message will be already converted to an object
|
||||
if (message.hasOwnProperty('value')) {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action, message.label, message.value]);
|
||||
}
|
||||
else if (message.hasOwnProperty('label')) {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action, message.label]);
|
||||
}
|
||||
else {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, message.action]);
|
||||
}
|
||||
}
|
||||
else if (channel == 'profile') {
|
||||
_gaq.push(['_trackEvent', my.gadgets[moduleId].name, 'go_to_profile', message]);
|
||||
document.location.href = '/' + location.pathname.split('/')[1] + '/display/n' + message;
|
||||
}
|
||||
else if (channel == 'hide') {
|
||||
document.getElementById(sender).parentNode.parentNode.style.display = 'none';
|
||||
}
|
||||
else if (channel == 'JSONPersonIds' || channel == 'JSONPubMedIds') {
|
||||
// do nothing, no need to alert
|
||||
}
|
||||
else {
|
||||
alert(sender + " publishes '" + message + "' to channel '" + channel + "'");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// helper functions
|
||||
my.findGadgetsAttachingTo = function(chromeId) {
|
||||
var retval = [];
|
||||
for (var i = 0; i < my.gadgets.length; i++) {
|
||||
if (my.gadgets[i].chrome_id == chromeId) {
|
||||
retval[retval.length] = my.gadgets[i];
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
};
|
||||
|
||||
my.removeGadgets = function(gadgetsToRemove) {
|
||||
for (var i = 0; i < gadgetsToRemove.length; i++) {
|
||||
for (var j = 0; j < my.gadgets.length; j++) {
|
||||
if (gadgetsToRemove[i].url == my.gadgets[j].url) {
|
||||
my.gadgets.splice(j, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
my.onSubscribe = function(sender, channel) {
|
||||
// lookup pubsub data based on channel and if a match is found, publish the data to that channel after a delay
|
||||
if (my.pubsubData[channel]) {
|
||||
gadgets.pubsubrouter.publish(channel, my.pubsubData[channel]);
|
||||
}
|
||||
else {
|
||||
alert(sender + " subscribes to channel '" + channel + "'");
|
||||
}
|
||||
//PageMethods.onSubscribe(sender, channel, my.pubsubHint, my.CallSuccess, my.CallFailed);
|
||||
};
|
||||
|
||||
my.removeParameterFromURL = function(url, parameter) {
|
||||
var urlparts= url.split('?'); // prefer to use l.search if you have a location/link object
|
||||
if (urlparts.length>=2) {
|
||||
var prefix= encodeURIComponent(parameter)+'=';
|
||||
var pars= urlparts[1].split(/[&;]/g);
|
||||
for (var i= pars.length; i-->0;) //reverse iteration as may be destructive
|
||||
if (pars[i].lastIndexOf(prefix, 0)!==-1) //idiom for string.startsWith
|
||||
pars.splice(i, 1);
|
||||
url= urlparts[0]+'?'+pars.join('&');
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
// publish the people
|
||||
my.CallSuccess = function(result) {
|
||||
gadgets.pubsubrouter.publish('person', result);
|
||||
};
|
||||
|
||||
// alert message on some failure
|
||||
my.CallFailed = function(error) {
|
||||
alert(error.get_message());
|
||||
};
|
||||
|
||||
my.requestGadgetMetaData = function(view, opt_callback) {
|
||||
var request = {
|
||||
context: {
|
||||
country: "default",
|
||||
language: "default",
|
||||
view: view,
|
||||
ignoreCache : my.noCache,
|
||||
container: "default"
|
||||
},
|
||||
gadgets: []
|
||||
};
|
||||
|
||||
for (var moduleId = 0; moduleId < my.gadgets.length; moduleId++) {
|
||||
// only add those with matching views
|
||||
if (my.gadgets[moduleId].view == view) {
|
||||
request.gadgets[request.gadgets.length] = {'url': my.gadgets[moduleId].url, 'moduleId': moduleId};
|
||||
}
|
||||
}
|
||||
|
||||
var makeRequestParams = {
|
||||
"CONTENT_TYPE" : "JSON",
|
||||
"METHOD" : "POST",
|
||||
"POST_DATA" : gadgets.json.stringify(request)};
|
||||
|
||||
gadgets.io.makeNonProxiedRequest(my.openSocialURL + "/gadgets/metadata",
|
||||
function(data) {
|
||||
data = data.data;
|
||||
if (opt_callback) {
|
||||
opt_callback(data);
|
||||
}
|
||||
},
|
||||
makeRequestParams,
|
||||
"application/javascript"
|
||||
);
|
||||
};
|
||||
|
||||
my.renderableGadgets = [];
|
||||
|
||||
my.generateGadgets = function (metadata) {
|
||||
// put them in moduleId order
|
||||
for (var i = 0; i < metadata.gadgets.length; i++) {
|
||||
var moduleId = metadata.gadgets[i].moduleId;
|
||||
// Notes by Eric. Not sure if I should have to calculate this myself, but I will.
|
||||
var height = metadata.gadgets[i].height;
|
||||
var width = metadata.gadgets[i].width;
|
||||
var viewPrefs = metadata.gadgets[i].views[my.gadgets[moduleId].view];
|
||||
if (viewPrefs) {
|
||||
height = viewPrefs.preferredHeight || height;
|
||||
width = viewPrefs.preferredWidth || width;
|
||||
}
|
||||
|
||||
var opt_params = { 'specUrl': metadata.gadgets[i].url, 'secureToken': my.gadgets[moduleId].secureToken,
|
||||
'title': metadata.gadgets[i].title, 'userPrefs': metadata.gadgets[i].userPrefs,
|
||||
'height': height, 'width': width, 'debug': my.debug};
|
||||
|
||||
// do a shallow merge of the opt_params from the database. This will overwrite anything with the same name, and we like that
|
||||
for (var attrname in my.gadgets[moduleId].opt_params) {
|
||||
opt_params[attrname] = my.gadgets[moduleId].opt_params[attrname];
|
||||
}
|
||||
|
||||
my.renderableGadgets[moduleId] = shindig.container.createGadget(opt_params);
|
||||
// set the metadata for easy access
|
||||
my.renderableGadgets[moduleId].setMetadata(metadata.gadgets[i]);
|
||||
}
|
||||
// this will be called multiple times, only render when all gadgets have been processed
|
||||
var ready = my.renderableGadgets.length == my.gadgets.length;
|
||||
for (var i = 0; ready && i < my.renderableGadgets.length; i++) {
|
||||
if (!my.renderableGadgets[i]) {
|
||||
ready = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ready) {
|
||||
shindig.container.addGadgets(my.renderableGadgets);
|
||||
shindig.container.renderGadgets();
|
||||
}
|
||||
};
|
||||
|
||||
my.init = function() {
|
||||
// overwrite this RPC function. Do it at this level so that rpc.f (this.f) is accessible for getting module ID
|
||||
// gadgets.rpc.register('requestNavigateTo', doProfilesNavigation);
|
||||
shindig.container = new ORNGContainer();
|
||||
|
||||
shindig.container.gadgetService = new ORNGGadgetService();
|
||||
shindig.container.layoutManager = new ORNGLayoutManager();
|
||||
|
||||
shindig.container.setNoCache(my.noCache);
|
||||
|
||||
// since we render multiple views, we need to do somethign fancy by swapping out this value in getIframeUrl
|
||||
shindig.container.setView('REPLACE_THIS_VIEW');
|
||||
|
||||
// do multiple times as needed if we have multiple views
|
||||
// find out what views are being used and call requestGadgetMetaData for each one
|
||||
var views = {};
|
||||
for (var moduleId = 0; moduleId < my.gadgets.length; moduleId++) {
|
||||
var view = my.gadgets[moduleId].view;
|
||||
if (!views[view]) {
|
||||
views[view] = view;
|
||||
my.requestGadgetMetaData(view, my.generateGadgets);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//ORNGContainer
|
||||
ORNGContainer = function() {
|
||||
shindig.IfrContainer.call(this);
|
||||
};
|
||||
|
||||
ORNGContainer.inherits(shindig.IfrContainer);
|
||||
|
||||
ORNGContainer.prototype.createGadget = function (opt_params) {
|
||||
if (opt_params.gadget_class) {
|
||||
return new window[opt_params.gadget_class](opt_params);
|
||||
}
|
||||
else {
|
||||
return new ORNGGadget(opt_params);
|
||||
}
|
||||
}
|
||||
|
||||
//ORNGLayoutManager.
|
||||
ORNGLayoutManager = function() {
|
||||
shindig.LayoutManager.call(this);
|
||||
};
|
||||
|
||||
ORNGLayoutManager.inherits(shindig.LayoutManager);
|
||||
|
||||
ORNGLayoutManager.prototype.getGadgetChrome = function(gadget) {
|
||||
var layoutRoot = document.getElementById(my.gadgets[gadget.id].chrome_id);
|
||||
if (layoutRoot) {
|
||||
var chrome = document.createElement('div');
|
||||
chrome.className = 'gadgets-gadget-chrome';
|
||||
layoutRoot.appendChild(chrome);
|
||||
return chrome;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
//ORNGGadgetService
|
||||
ORNGGadgetService = function() {
|
||||
shindig.IfrGadgetService.call(this);
|
||||
};
|
||||
|
||||
ORNGGadgetService.inherits(shindig.IfrGadgetService);
|
||||
|
||||
ORNGGadgetService.prototype.setTitle = function (title) {
|
||||
var moduleId = shindig.container.gadgetService.getGadgetIdFromModuleId(this.f);
|
||||
if (my.gadgets[moduleId].view == 'canvas') {
|
||||
ORNGGadgetService.setCanvasTitle(title);
|
||||
}
|
||||
else {
|
||||
var element = document.getElementById(this.f + '_title');
|
||||
element.innerHTML = my.renderableGadgets[moduleId].getTitleHtml(title);
|
||||
}
|
||||
};
|
||||
|
||||
ORNGGadgetService.setCanvasTitle = function (title) {
|
||||
document.getElementById("gadgets-title").innerHTML = title.replace(/&/g, '&').replace(/</g, '<');
|
||||
}
|
||||
|
||||
ORNGGadgetService.prototype.requestNavigateTo = function(view, opt_params) {
|
||||
var urlTemplate = gadgets.config.get('views')[view].urlTemplate;
|
||||
var url = urlTemplate || 'OpenSocial.aspx?';
|
||||
|
||||
url += window.location.search.substring(1);
|
||||
|
||||
// remove appId if present
|
||||
url = my.removeParameterFromURL(url, 'appId');
|
||||
|
||||
// Add appId if the URL Template begins with the word 'Gadget'
|
||||
if (urlTemplate.indexOf('Gadget') == 0) {
|
||||
var moduleId = shindig.container.gadgetService.getGadgetIdFromModuleId(this.f);
|
||||
var appId = my.gadgets[moduleId].appId;
|
||||
url += '&appId=' + appId;
|
||||
}
|
||||
|
||||
if (opt_params) {
|
||||
var paramStr = gadgets.json.stringify(opt_params);
|
||||
if (paramStr.length > 0) {
|
||||
url += '&appParams=' + encodeURIComponent(paramStr);
|
||||
}
|
||||
}
|
||||
if (url && document.location.href.indexOf(url) == -1) {
|
||||
document.location.href = url;
|
||||
}
|
||||
};
|
||||
|
||||
//ORNGGadget
|
||||
ORNGGadget = function(opt_params) {
|
||||
shindig.BaseIfrGadget.call(this, opt_params);
|
||||
this.debug = my.debug;
|
||||
this.serverBase_ = my.openSocialURL + "/gadgets/";
|
||||
var gadget = this;
|
||||
var subClass = shindig.IfrGadget;
|
||||
this.metadata = {};
|
||||
for (var name in subClass) if (subClass.hasOwnProperty(name)) {
|
||||
if (name == 'getIframeUrl') {
|
||||
// we need to keep this old one
|
||||
gadget['originalGetIframeUrl'] = subClass[name];
|
||||
}
|
||||
else if (name != 'finishRender') {
|
||||
gadget[name] = subClass[name];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ORNGGadget.inherits(shindig.BaseIfrGadget);
|
||||
|
||||
ORNGGadget.prototype.setMetadata = function(metadata) {
|
||||
this.metadata = metadata;
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.hasFeature = function(feature) {
|
||||
for (var i = 0; i < this.metadata.features.length; i++) {
|
||||
if (this.metadata.features[i] == feature) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.getAdditionalParams = function() {
|
||||
var params = '';
|
||||
for (var key in my.gadgets[this.id].additionalParams) {
|
||||
params += '&' + key + '=' + my.gadgets[this.id].additionalParams[key];
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.getIframeUrl = function() {
|
||||
var url = this.originalGetIframeUrl();
|
||||
return url.replace('REPLACE_THIS_VIEW', my.gadgets[this.id].view);
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.getTitleHtml = function(title) {
|
||||
return title ? title.replace(/&/g, '&').replace(/</g, '<') : 'Gagdget';
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.getTitleBarContent = function(continuation) {
|
||||
if (my.gadgets[this.id].view == 'canvas') {
|
||||
ORNGGadgetService.setCanvasTitle(this.title);
|
||||
continuation('<span class="gadgets-gadget-canvas-title"></span>');
|
||||
}
|
||||
else {
|
||||
continuation(
|
||||
'<div id="' + this.cssClassTitleBar + '-' + this.id +
|
||||
'" class="' + this.cssClassTitleBar + '"><span class="' +
|
||||
this.cssClassTitleButtonBar + '">' +
|
||||
'</span> <span id="' +
|
||||
this.getIframeId() + '_title" class="' + this.cssClassTitle + '">' +
|
||||
this.getTitleHtml(this.title) + '</span><span id="' +
|
||||
this.getIframeId() + '_status" class="gadgets-gadget-status"></span></div>');
|
||||
}
|
||||
};
|
||||
|
||||
ORNGGadget.prototype.finishRender = function(chrome) {
|
||||
window.frames[this.getIframeId()].location = this.getIframeUrl();
|
||||
if (chrome && this.width) {
|
||||
// set the gadget box width, and remember that we always render as open
|
||||
chrome.style.width = this.width + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
// ORNGToggleGadget
|
||||
ORNGToggleGadget = function(opt_params) {
|
||||
ORNGGadget.call(this, opt_params);
|
||||
};
|
||||
|
||||
ORNGToggleGadget.inherits(ORNGGadget);
|
||||
|
||||
ORNGToggleGadget.prototype.handleToggle = function (track) {
|
||||
var gadgetIframe = document.getElementById(this.getIframeId());
|
||||
if (gadgetIframe) {
|
||||
var gadgetContent = gadgetIframe.parentNode;
|
||||
var gadgetImg = document.getElementById('gadgets-gadget-title-image-'
|
||||
+ this.id);
|
||||
if (gadgetContent.style.display) {
|
||||
//OPEN
|
||||
if (this.width) {
|
||||
gadgetContent.parentNode.style.width = this.width + 'px';
|
||||
}
|
||||
|
||||
gadgetContent.style.display = '';
|
||||
gadgetImg.src = '/' + location.pathname.split('/')[1] + '/themes/wilma/images/green_minus_sign.gif'
|
||||
// refresh if certain features require so
|
||||
//if (this.hasFeature('dynamic-height')) {
|
||||
if (my.gadgets[this.id].chrome_id == 'gadgets-search') {
|
||||
this.refresh();
|
||||
document.getElementById(this.getIframeId()).contentWindow.location
|
||||
.reload(true);
|
||||
}
|
||||
|
||||
if (my.gadgets[this.id].view == 'home') {
|
||||
if (track) {
|
||||
// record in google analytics
|
||||
_gaq.push(['_trackEvent', my.gadgets[this.id].name,
|
||||
'OPEN_IN_EDIT', 'profile_edit_view']);
|
||||
}
|
||||
} else {
|
||||
// only do this for user centric activities
|
||||
if (gadgets.util.getUrlParameters()['Person'] != undefined) {
|
||||
osapi.activities
|
||||
.create(
|
||||
{
|
||||
'userId': gadgets.util
|
||||
.getUrlParameters()['Person'],
|
||||
'appId': my.gadgets[this.id].appId,
|
||||
'activity': {
|
||||
'postedTime': new Date().getTime(),
|
||||
'title': 'gadget was viewed',
|
||||
'body': my.gadgets[this.id].name
|
||||
+ ' gadget was viewed'
|
||||
}
|
||||
}).execute(function (response) {
|
||||
});
|
||||
}
|
||||
if (track) {
|
||||
// record in google analytics
|
||||
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'OPEN']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//CLOSE
|
||||
if (this.closed_width) {
|
||||
gadgetContent.parentNode.style.width = this.closed_width + 'px';
|
||||
}
|
||||
|
||||
gadgetContent.style.display = 'none';
|
||||
gadgetImg.src = '/' + location.pathname.split('/')[1] + '/themes/wilma/images/green_plus_sign.gif'
|
||||
if (track) {
|
||||
if (my.gadgets[this.id].view == 'home') {
|
||||
// record in google analytics
|
||||
_gaq.push(['_trackEvent', my.gadgets[this.id].name,
|
||||
'CLOSE_IN_EDIT', 'profile_edit_view']);
|
||||
} else {
|
||||
// record in google analytics
|
||||
_gaq.push(['_trackEvent', my.gadgets[this.id].name, 'CLOSE']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ORNGToggleGadget.prototype.getTitleHtml = function(title) {
|
||||
return '<a href="#" onclick="shindig.container.getGadget('
|
||||
+ this.id + ').handleToggle(true);return false;">'
|
||||
+ (title ? title.replace(/&/g, '&').replace(/</g, '<') : 'Gadget') + '</a>';
|
||||
};
|
||||
|
||||
|
||||
ORNGToggleGadget.prototype.getTitleBarContent = function(continuation) {
|
||||
if (my.gadgets[this.id].view == 'canvas') {
|
||||
ORNGGadgetService.setCanvasTitle(title);
|
||||
continuation('<span class="gadgets-gadget-canvas-title"></span>');
|
||||
} else {
|
||||
continuation('<div id="'
|
||||
+ this.cssClassTitleBar
|
||||
+ '-'
|
||||
+ this.id
|
||||
+ '" class="'
|
||||
+ this.cssClassTitleBar
|
||||
+ '"><span class="'
|
||||
+ this.cssClassTitleButtonBar
|
||||
+ '">'
|
||||
+ '<a href="#" onclick="shindig.container.getGadget('
|
||||
+ this.id
|
||||
+ ').handleToggle(true);return false;" class="'
|
||||
+ this.cssClassTitleButton
|
||||
+ '"><img id="gadgets-gadget-title-image-'
|
||||
+ this.id
|
||||
+ '" src="/' + location.pathname.split('/')[1] + '/themes/wilma/images/green_minus_sign.gif"/></a></span> <span id="'
|
||||
+ this.getIframeId() + '_title" class="' + this.cssClassTitle
|
||||
+ '">' + this.getTitleHtml(this.title)
|
||||
+ '</span><span id="' + this.getIframeId()
|
||||
+ '_status" class="gadgets-gadget-status"></span></div>');
|
||||
}
|
||||
};
|
||||
|
||||
ORNGToggleGadget.prototype.finishRender = function(chrome) {
|
||||
window.frames[this.getIframeId()].location = this.getIframeUrl();
|
||||
if (this.start_closed) {
|
||||
this.handleToggle(false);
|
||||
}
|
||||
else if (chrome && this.width) {
|
||||
chrome.style.width = this.width + 'px';
|
||||
}
|
||||
};
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$.extend(this, i18nStrings);
|
||||
|
||||
var pageDeletion = {
|
||||
// on initial page setup
|
||||
onLoad:function(){
|
||||
if (this.disableFormInUnsupportedBrowsers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
},
|
||||
initObjects:function() {
|
||||
this.deleteLinks = $("a[cmd='deletePage']");
|
||||
},
|
||||
bindEventListeners:function() {
|
||||
this.deleteLinks.click(function(event) {
|
||||
var href=$(this).attr("href");
|
||||
var pageTitle = $(this).attr("pageTitle");
|
||||
var confirmResult = confirm( i18nStrings.confirmPageDeletion + " " + pageTitle + "?");
|
||||
if(confirmResult) {
|
||||
//Continue with the link
|
||||
return true;
|
||||
} else {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
disableFormInUnsupportedBrowsers: function() {
|
||||
var disableWrapper = $('#ie67DisableWrapper');
|
||||
|
||||
// Check for unsupported browsers only if the element exists on the page
|
||||
if (disableWrapper.length) {
|
||||
if (vitro.browserUtils.isIELessThan8()) {
|
||||
disableWrapper.show();
|
||||
$('.noIE67').hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
pageDeletion.onLoad();
|
||||
});
|
||||
|
||||
|
|
@ -1,405 +0,0 @@
|
|||
/*!
|
||||
* g.Raphael 0.4.1 - Charting library, based on Raphaël
|
||||
*
|
||||
* Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com)
|
||||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
|
||||
*/
|
||||
Raphael.fn.g.barchart = function (x, y, width, height, values, opts) {
|
||||
opts = opts || {};
|
||||
var type = {round: "round", sharp: "sharp", soft: "soft"}[opts.type] || "square",
|
||||
gutter = parseFloat(opts.gutter || "20%"),
|
||||
chart = this.set(),
|
||||
bars = this.set(),
|
||||
covers = this.set(),
|
||||
covers2 = this.set(),
|
||||
total = Math.max.apply(Math, values),
|
||||
stacktotal = [],
|
||||
paper = this,
|
||||
multi = 0,
|
||||
colors = opts.colors || this.g.colors,
|
||||
singleColor = opts.singleColor,
|
||||
len = values.length;
|
||||
if (this.raphael.is(values[0], "array")) {
|
||||
total = [];
|
||||
multi = len;
|
||||
len = 0;
|
||||
for (var i = values.length; i--;) {
|
||||
bars.push(this.set());
|
||||
total.push(Math.max.apply(Math, values[i]));
|
||||
len = Math.max(len, values[i].length);
|
||||
}
|
||||
if (opts.stacked) {
|
||||
for (var i = len; i--;) {
|
||||
var tot = 0;
|
||||
for (var j = values.length; j--;) {
|
||||
tot +=+ values[j][i] || 0;
|
||||
}
|
||||
stacktotal.push(tot);
|
||||
}
|
||||
}
|
||||
for (var i = values.length; i--;) {
|
||||
if (values[i].length < len) {
|
||||
for (var j = len; j--;) {
|
||||
values[i].push(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
total = Math.max.apply(Math, opts.stacked ? stacktotal : total);
|
||||
}
|
||||
|
||||
total = (opts.to) || total;
|
||||
var barwidth = width / (len * (100 + gutter) + gutter) * 100,
|
||||
barhgutter = barwidth * gutter / 100,
|
||||
barvgutter = opts.vgutter == null ? 20 : opts.vgutter,
|
||||
stack = [],
|
||||
X = x + barhgutter,
|
||||
Y = (height - 2 * barvgutter) / total;
|
||||
if (!opts.stretch) {
|
||||
barhgutter = Math.round(barhgutter);
|
||||
barwidth = Math.floor(barwidth);
|
||||
}
|
||||
!opts.stacked && (barwidth /= multi || 1);
|
||||
for (var i = 0; i < len; i++) {
|
||||
stack = [];
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var h = Math.round((multi ? values[j][i] : values[i]) * Y),
|
||||
top = y + height - barvgutter - h,
|
||||
bar = this.g.finger(Math.round(X + barwidth / 2), top + h, barwidth, h, true, type).attr({stroke: "none", fill: singleColor ? singleColor : (colors[multi ? j : i]) });
|
||||
if (multi) {
|
||||
bars[j].push(bar);
|
||||
} else {
|
||||
bars.push(bar);
|
||||
}
|
||||
bar.y = top;
|
||||
bar.x = Math.round(X + barwidth / 2);
|
||||
bar.w = barwidth;
|
||||
bar.h = h;
|
||||
bar.value = multi ? values[j][i] : values[i];
|
||||
if (!opts.stacked) {
|
||||
X += barwidth;
|
||||
} else {
|
||||
stack.push(bar);
|
||||
}
|
||||
}
|
||||
if (opts.stacked) {
|
||||
var cvr;
|
||||
covers2.push(cvr = this.rect(stack[0].x - stack[0].w / 2, y, barwidth, height).attr(this.g.shim));
|
||||
cvr.bars = this.set();
|
||||
var size = 0;
|
||||
for (var s = stack.length; s--;) {
|
||||
stack[s].toFront();
|
||||
}
|
||||
for (var s = 0, ss = stack.length; s < ss; s++) {
|
||||
var bar = stack[s],
|
||||
cover,
|
||||
h = (size + bar.value) * Y,
|
||||
path = this.g.finger(bar.x, y + height - barvgutter - !!size * .5, barwidth, h, true, type, 1);
|
||||
cvr.bars.push(bar);
|
||||
size && bar.attr({path: path});
|
||||
bar.h = h;
|
||||
bar.y = y + height - barvgutter - !!size * .5 - h;
|
||||
covers.push(cover = this.rect(bar.x - bar.w / 2, bar.y, barwidth, bar.value * Y).attr(this.g.shim));
|
||||
cover.bar = bar;
|
||||
cover.value = bar.value;
|
||||
size += bar.value;
|
||||
}
|
||||
X += barwidth;
|
||||
}
|
||||
X += barhgutter;
|
||||
}
|
||||
covers2.toFront();
|
||||
X = x + barhgutter;
|
||||
if (!opts.stacked) {
|
||||
for (var i = 0; i < len; i++) {
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var cover;
|
||||
covers.push(cover = this.rect(Math.round(X), y + barvgutter, barwidth, height - barvgutter).attr(this.g.shim));
|
||||
cover.bar = multi ? bars[j][i] : bars[i];
|
||||
cover.value = cover.bar.value;
|
||||
X += barwidth;
|
||||
}
|
||||
X += barhgutter;
|
||||
}
|
||||
}
|
||||
chart.label = function (labels, isBottom) {
|
||||
labels = labels || [];
|
||||
this.labels = paper.set();
|
||||
var L, l = -Infinity;
|
||||
if (opts.stacked) {
|
||||
for (var i = 0; i < len; i++) {
|
||||
var tot = 0;
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
tot += multi ? values[j][i] : values[i];
|
||||
if (j == multi - 1) {
|
||||
var label = paper.g.labelise(labels[i], tot, total);
|
||||
L = paper.g.text(bars[0][i].x, y + height - barvgutter / 2, label).insertBefore(covers[i * (multi || 1) + j]);
|
||||
var bb = L.getBBox();
|
||||
if (bb.x - 7 < l) {
|
||||
L.remove();
|
||||
} else {
|
||||
this.labels.push(L);
|
||||
l = bb.x + bb.width;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < len; i++) {
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var label = paper.g.labelise(multi ? labels[j] && labels[j][i] : labels[i], multi ? values[j][i] : values[i], total);
|
||||
L = paper.g.text(bars[i * (multi || 1) + j].x, isBottom ? y + height - barvgutter / 2 : bars[i * (multi || 1) + j].y - 10, label).insertBefore(covers[i * (multi || 1) + j]);
|
||||
var bb = L.getBBox();
|
||||
if (bb.x - 7 < l) {
|
||||
L.remove();
|
||||
} else {
|
||||
this.labels.push(L);
|
||||
l = bb.x + bb.width;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.hover = function (fin, fout) {
|
||||
covers2.hide();
|
||||
covers.show();
|
||||
fout = fout || function () {};
|
||||
covers.mouseover(fin).mouseout(fout);
|
||||
return this;
|
||||
};
|
||||
chart.hoverColumn = function (fin, fout) {
|
||||
covers.hide();
|
||||
covers2.show();
|
||||
fout = fout || function () {};
|
||||
covers2.mouseover(fin).mouseout(fout);
|
||||
return this;
|
||||
};
|
||||
chart.click = function (f) {
|
||||
covers2.hide();
|
||||
covers.show();
|
||||
covers.click(f);
|
||||
return this;
|
||||
};
|
||||
chart.each = function (f) {
|
||||
if (!Raphael.is(f, "function")) {
|
||||
return this;
|
||||
}
|
||||
for (var i = covers.length; i--;) {
|
||||
f.call(covers[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.eachColumn = function (f) {
|
||||
if (!Raphael.is(f, "function")) {
|
||||
return this;
|
||||
}
|
||||
for (var i = covers2.length; i--;) {
|
||||
f.call(covers2[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.clickColumn = function (f) {
|
||||
covers.hide();
|
||||
covers2.show();
|
||||
covers2.click(f);
|
||||
return this;
|
||||
};
|
||||
chart.push(bars, covers, covers2);
|
||||
chart.bars = bars;
|
||||
chart.covers = covers;
|
||||
return chart;
|
||||
};
|
||||
Raphael.fn.g.hbarchart = function (x, y, width, height, values, opts) {
|
||||
opts = opts || {};
|
||||
var type = {round: "round", sharp: "sharp", soft: "soft"}[opts.type] || "square",
|
||||
gutter = parseFloat(opts.gutter || "20%"),
|
||||
chart = this.set(),
|
||||
bars = this.set(),
|
||||
covers = this.set(),
|
||||
covers2 = this.set(),
|
||||
total = Math.max.apply(Math, values),
|
||||
stacktotal = [],
|
||||
paper = this,
|
||||
multi = 0,
|
||||
colors = opts.colors || this.g.colors,
|
||||
singleColor = opts.singleColor,
|
||||
len = values.length;
|
||||
if (this.raphael.is(values[0], "array")) {
|
||||
total = [];
|
||||
multi = len;
|
||||
len = 0;
|
||||
for (var i = values.length; i--;) {
|
||||
bars.push(this.set());
|
||||
total.push(Math.max.apply(Math, values[i]));
|
||||
len = Math.max(len, values[i].length);
|
||||
}
|
||||
if (opts.stacked) {
|
||||
for (var i = len; i--;) {
|
||||
var tot = 0;
|
||||
for (var j = values.length; j--;) {
|
||||
tot +=+ values[j][i] || 0;
|
||||
}
|
||||
stacktotal.push(tot);
|
||||
}
|
||||
}
|
||||
for (var i = values.length; i--;) {
|
||||
if (values[i].length < len) {
|
||||
for (var j = len; j--;) {
|
||||
values[i].push(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
total = Math.max.apply(Math, opts.stacked ? stacktotal : total);
|
||||
}
|
||||
|
||||
total = (opts.to) || total;
|
||||
var barheight = Math.floor(height / (len * (100 + gutter) + gutter) * 100),
|
||||
bargutter = Math.floor(barheight * gutter / 100),
|
||||
stack = [],
|
||||
Y = y + bargutter,
|
||||
X = (width - 1) / total;
|
||||
!opts.stacked && (barheight /= multi || 1);
|
||||
for (var i = 0; i < len; i++) {
|
||||
stack = [];
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var val = multi ? values[j][i] : values[i],
|
||||
bar = this.g.finger(x, Y + barheight / 2, Math.round(val * X), barheight - 1, false, type).attr({stroke: "none", fill: singleColor ? singleColor : (colors[multi ? j : i])});
|
||||
if (multi) {
|
||||
bars[j].push(bar);
|
||||
} else {
|
||||
bars.push(bar);
|
||||
}
|
||||
bar.x = x + Math.round(val * X);
|
||||
bar.y = Y + barheight / 2;
|
||||
bar.w = Math.round(val * X);
|
||||
bar.h = barheight;
|
||||
bar.value = +val;
|
||||
if (!opts.stacked) {
|
||||
Y += barheight;
|
||||
} else {
|
||||
stack.push(bar);
|
||||
}
|
||||
}
|
||||
if (opts.stacked) {
|
||||
var cvr = this.rect(x, stack[0].y - stack[0].h / 2, width, barheight).attr(this.g.shim);
|
||||
covers2.push(cvr);
|
||||
cvr.bars = this.set();
|
||||
var size = 0;
|
||||
for (var s = stack.length; s--;) {
|
||||
stack[s].toFront();
|
||||
}
|
||||
for (var s = 0, ss = stack.length; s < ss; s++) {
|
||||
var bar = stack[s],
|
||||
cover,
|
||||
val = Math.round((size + bar.value) * X),
|
||||
path = this.g.finger(x, bar.y, val, barheight - 1, false, type, 1);
|
||||
cvr.bars.push(bar);
|
||||
size && bar.attr({path: path});
|
||||
bar.w = val;
|
||||
bar.x = x + val;
|
||||
covers.push(cover = this.rect(x + size * X, bar.y - bar.h / 2, bar.value * X, barheight).attr(this.g.shim));
|
||||
cover.bar = bar;
|
||||
size += bar.value;
|
||||
}
|
||||
Y += barheight;
|
||||
}
|
||||
Y += bargutter;
|
||||
}
|
||||
covers2.toFront();
|
||||
Y = y + bargutter;
|
||||
if (!opts.stacked) {
|
||||
for (var i = 0; i < len; i++) {
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var cover = this.rect(x, Y, width, barheight).attr(this.g.shim);
|
||||
covers.push(cover);
|
||||
cover.bar = multi ? bars[j][i] : bars[i];
|
||||
cover.value = cover.bar.value;
|
||||
Y += barheight;
|
||||
}
|
||||
Y += bargutter;
|
||||
}
|
||||
}
|
||||
chart.label = function (labels, isInside) {
|
||||
labels = labels || [];
|
||||
this.labels = paper.set();
|
||||
var L, l = -Infinity;
|
||||
if (opts.stacked) {
|
||||
for (var i = 0; i < len; i++) {
|
||||
var tot = 0;
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
tot += multi ? values[j][i] : values[i];
|
||||
if (j == multi - 1) {
|
||||
var label = paper.g.labelise(labels[i], tot, total);
|
||||
L = paper.g.text(0, bars[j][i].y, label).insertBefore(covers[i * (multi || 1) + j]);
|
||||
var bb = L.getBBox();
|
||||
if(isInside)
|
||||
L.translate(x + bb.width / 2 + 2, bb.height / 4);
|
||||
else
|
||||
L.translate(x - bb.width / 2 - 2, bb.height / 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < len; i++) {
|
||||
for (var j = 0; j < (multi || 1); j++) {
|
||||
var label = paper.g.labelise(labels[i], multi ? values[j][i] : values[i], total);
|
||||
L = paper.g.text(0, bars[j][i].y, label).insertBefore(covers[i * (multi || 1) + j]);
|
||||
var bb = L.getBBox();
|
||||
if(isInside)
|
||||
L.translate(x + bb.width / 2 + 2, bb.height / 4);
|
||||
else
|
||||
L.translate(x - bb.width / 2 - 2, bb.height / 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.hover = function (fin, fout) {
|
||||
covers2.hide();
|
||||
covers.show();
|
||||
fout = fout || function () {};
|
||||
covers.mouseover(fin).mouseout(fout);
|
||||
return this;
|
||||
};
|
||||
chart.hoverColumn = function (fin, fout) {
|
||||
covers.hide();
|
||||
covers2.show();
|
||||
fout = fout || function () {};
|
||||
covers2.mouseover(fin).mouseout(fout);
|
||||
return this;
|
||||
};
|
||||
chart.each = function (f) {
|
||||
if (!Raphael.is(f, "function")) {
|
||||
return this;
|
||||
}
|
||||
for (var i = covers.length; i--;) {
|
||||
f.call(covers[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.eachColumn = function (f) {
|
||||
if (!Raphael.is(f, "function")) {
|
||||
return this;
|
||||
}
|
||||
for (var i = covers2.length; i--;) {
|
||||
f.call(covers2[i]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
chart.click = function (f) {
|
||||
covers2.hide();
|
||||
covers.show();
|
||||
covers.click(f);
|
||||
return this;
|
||||
};
|
||||
chart.clickColumn = function (f) {
|
||||
covers.hide();
|
||||
covers2.show();
|
||||
covers2.click(f);
|
||||
return this;
|
||||
};
|
||||
chart.push(bars, covers, covers2);
|
||||
chart.bars = bars;
|
||||
chart.covers = covers;
|
||||
return chart;
|
||||
};
|
|
@ -1,31 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/*
|
||||
Functions for use by searchIndex.ftl
|
||||
*/
|
||||
|
||||
function updateSearchIndexerStatus() {
|
||||
$.ajax({
|
||||
url: searchIndexerStatusUrl,
|
||||
dataType: "html",
|
||||
complete: function(xhr, status) {
|
||||
if (xhr.status == 200) {
|
||||
updatePanelContents(xhr.responseText);
|
||||
setTimeout(updateSearchIndexerStatus,5000);
|
||||
} else {
|
||||
displayErrorMessage(xhr.status + " " + xhr.statusText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updatePanelContents(contents) {
|
||||
document.getElementById("searchIndexerStatus").innerHTML = contents;
|
||||
}
|
||||
|
||||
function displayErrorMessage(message) {
|
||||
document.getElementById("searchIndexerError").innerHTML = "<h3>" + message + "</h3>";
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(updateSearchIndexerStatus());
|
|
@ -1,70 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
$(document).ready(function(){
|
||||
// This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon.
|
||||
|
||||
$('img#downloadIcon').each(function()
|
||||
{
|
||||
$(this).qtip(
|
||||
{
|
||||
content: {
|
||||
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||
text: '<div style="float:right; width:150px;border-left: 1px solid #A6B1B0; padding: 3px 0 0 20px">'
|
||||
+'<p><label for="amount" style="font-size:14px;">Maximum Records:</label>'
|
||||
+'<input disabled type="text" id="amount" style="margin-left:35px; border: 0; color: #f6931f; font-weight: bold; width:45px" /></p>'
|
||||
+'<div id="slider-vertical" style="margin-left:60px; margin-top: -20px; height: 100px; background-color:white"></div>'
|
||||
+'<br /><a class="close" href="#">close</a></div>'
|
||||
+'<div style="float:left; width:280px"><h5>Download the results from this search</h5> '
|
||||
+'<h5 class ="download-url"><a id=xmlDownload href="' + urlsBase + '/search?' + queryText +'&xml=1&hitsPerPage=500">download results in XML format</a></h5>'
|
||||
+'<h5 class ="download-url"><a id=csvDownload href="' + urlsBase + '/search?' + queryText +'&csv=1&hitsPerPage=500">download results in CSV format</a></h5>'
|
||||
+'</div>'
|
||||
|
||||
},
|
||||
position: {
|
||||
corner: {
|
||||
target: 'bottomLeft',
|
||||
tooltip: 'topLeft'
|
||||
}
|
||||
},
|
||||
show: {
|
||||
when: {event: 'click'}
|
||||
},
|
||||
hide: {
|
||||
fixed: true, // Make it fixed so it can be hovered over and interacted with
|
||||
when: {
|
||||
target: $('a.close'),
|
||||
event: 'click'
|
||||
}
|
||||
},
|
||||
style: {
|
||||
padding: '1em',
|
||||
width: 500,
|
||||
backgroundColor: '#f1f2ee'
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$( "#slider-vertical" ).slider({
|
||||
orientation: "vertical",
|
||||
range: "min",
|
||||
min: 10,
|
||||
max: 1000,
|
||||
value: 500,
|
||||
slide: function( event, ui ) {
|
||||
$( "#amount" ).val( ui.value );
|
||||
$('#csvDownload').attr("href", urlsBase + '/search?' + queryText +'&csv=1&hitsPerPage=' + ui.value);
|
||||
$('#xmlDownload').attr("href", urlsBase + '/search?' + queryText +'&xml=1&hitsPerPage=' + ui.value);
|
||||
}
|
||||
});
|
||||
$( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
|
||||
|
||||
|
||||
// Prevent close link for URI qTip from requesting bogus '#' href
|
||||
$('a.close').click(function() {
|
||||
$('#downloadIcon').qtip("hide");
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
/*
|
||||
selectivizr v1.0.0 - (c) Keith Clark, freely distributable under the terms of the MIT license.
|
||||
selectivizr.com
|
||||
*/
|
||||
(function(x){function K(a){return a.replace(L,o).replace(M,function(b,e,c){b=c.split(",");c=0;for(var g=b.length;c<g;c++){var j=N(b[c].replace(O,o).replace(P,o))+t,f=[];b[c]=j.replace(Q,function(d,k,l,i,h){if(k){if(f.length>0){d=f;var u;h=j.substring(0,h).replace(R,n);if(h==n||h.charAt(h.length-1)==t)h+="*";try{u=v(h)}catch(da){}if(u){h=0;for(l=u.length;h<l;h++){i=u[h];for(var y=i.className,z=0,S=d.length;z<S;z++){var q=d[z];if(!RegExp("(^|\\s)"+q.className+"(\\s|$)").test(i.className))if(q.b&&(q.b===true||q.b(i)===true))y=A(y,q.className,true)}i.className=y}}f=[]}return k}else{if(k=l?T(l):!B||B.test(i)?{className:C(i),b:true}:null){f.push(k);return"."+k.className}return d}})}return e+b.join(",")})}function T(a){var b=true,e=C(a.slice(1)),c=a.substring(0,5)==":not(",g,j;if(c)a=a.slice(5,-1);var f=a.indexOf("(");if(f>-1)a=a.substring(0,f);if(a.charAt(0)==":")switch(a.slice(1)){case "root":b=function(d){return c?d!=D:d==D};break;case "target":if(p==8){b=function(d){function k(){var l=location.hash,i=l.slice(1);return c?l==""||d.id!=i:l!=""&&d.id==i}x.attachEvent("onhashchange",function(){r(d,e,k())});return k()};break}return false;case "checked":b=function(d){U.test(d.type)&&d.attachEvent("onpropertychange",function(){event.propertyName=="checked"&&r(d,e,d.checked!==c)});return d.checked!==c};break;case "disabled":c=!c;case "enabled":b=function(d){if(V.test(d.tagName)){d.attachEvent("onpropertychange",function(){event.propertyName=="$disabled"&&r(d,e,d.a===c)});w.push(d);d.a=d.disabled;return d.disabled===c}return a==":enabled"?c:!c};break;case "focus":g="focus";j="blur";case "hover":if(!g){g="mouseenter";j="mouseleave"}b=function(d){d.attachEvent("on"+(c?j:g),function(){r(d,e,true)});d.attachEvent("on"+(c?g:j),function(){r(d,e,false)});return c};break;default:if(!W.test(a))return false;break}return{className:e,b:b}}function C(a){return E+"-"+(p==6&&X?Y++:a.replace(Z,function(b){return b.charCodeAt(0)}))}function N(a){return a.replace(F,o).replace($,t)}function r(a,b,e){var c=a.className;b=A(c,b,e);if(b!=c){a.className=b;a.parentNode.className+=n}}function A(a,b,e){var c=RegExp("(^|\\s)"+b+"(\\s|$)"),g=c.test(a);return e?g?a:a+t+b:g?a.replace(c,o).replace(F,o):a}function G(a,b){if(/^https?:\/\//i.test(a))return b.substring(0,b.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return b.substring(0,b.indexOf("/",8))+a;var e=b.split("?")[0];if(a.charAt(0)!="?"&&e.charAt(e.length-1)!="/")e=e.substring(0,e.lastIndexOf("/")+1);return e+a}function H(a){if(a){s.open("GET",a,false);s.send();return(s.status==200?s.responseText:n).replace(aa,n).replace(ba,function(b,e,c){return H(G(c,a))})}return n}function ca(){var a,b;a=m.getElementsByTagName("BASE");for(var e=a.length>0?a[0].href:m.location.href,c=0;c<m.styleSheets.length;c++){b=m.styleSheets[c];if(b.href!=n)if(a=G(b.href,e))b.cssText=K(H(a))}w.length>0&&setInterval(function(){for(var g=0,j=w.length;g<j;g++){var f=w[g];if(f.disabled!==f.a)if(f.disabled){f.disabled=false;f.a=true;f.disabled=true}else f.a=f.disabled}},250)}if(!/*@cc_on!@*/true){var m=document,D=m.documentElement,s=function(){if(x.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),p=/MSIE ([\d])/.exec(navigator.userAgent)[1];if(!(m.compatMode!="CSS1Compat"||p<6||p>8||!s)){var I={NW:"*.Dom.select",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",MooTools:"$$",Sizzle:"*",jQuery:"*",dojo:"*.query"},v,w=[],Y=0,X=true,E="slvzr",J=E+"DOMReady",aa=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,ba=/@import\s*url\(\s*(["'])?(.*?)\1\s*\)[\w\W]*?;/g,W=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,L=/:(:first-(?:line|letter))/g,M=/(^|})\s*([^\{]*?[\[:][^{]+)/g,Q=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,R=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,Z=/[^\w-]/g,V=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,U=/^(checkbox|radio)$/,B=p==8?/[\$\^]=(['"])\1/:p==7?/[\$\^*]=(['"])\1/:null,O=/([(\[+~])\s+/g,P=/\s+([)\]+~])/g,$=/\s+/g,F=/^\s*((?:[\S\s]*\S)?)\s*$/,n="",t=" ",o="$1";m.write("<script id="+J+" defer src='//:'><\/script>");m.getElementById(J).onreadystatechange=function(){if(this.readyState=="complete"){a:{var a;for(var b in I)if(x[b]&&(a=eval(I[b].replace("*",b)))){v=a;break a}v=false}if(v){ca();this.parentNode.removeChild(this)}}}}}})(this);
|
|
@ -1,305 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var classHierarchyUtils = {
|
||||
onLoad: function(urlBase,displayOption) {
|
||||
$.extend(this, i18nStrings);
|
||||
this.imagePath = urlBase + "/images/";
|
||||
this.displayOption = displayOption;
|
||||
this.initObjects();
|
||||
this.expandAll.hide();
|
||||
|
||||
if ( this.displayOption == "all" ) {
|
||||
this.buildAllClassesHtml();
|
||||
}
|
||||
else if ( this.displayOption == "group" ) {
|
||||
this.buildClassGroupHtml();
|
||||
}
|
||||
else {
|
||||
this.buildClassHierarchyHtml();
|
||||
this.wireExpandLink();
|
||||
}
|
||||
if ( this.displayOption == "asserted" || this.displayOption == "inferred" || this.displayOption == "group") {
|
||||
this.expandAll.show();
|
||||
}
|
||||
this.bindEventListeners();
|
||||
},
|
||||
|
||||
initObjects: function() {
|
||||
this.expandAll = $('span#expandAll').find('a');
|
||||
this.classCounter = 1;
|
||||
this.expandCounter = 1;
|
||||
this.classHtml = "";
|
||||
this.clickableSpans = [] ;
|
||||
this.form = $('form#classHierarchyForm');
|
||||
this.select = $('select#displayOption');
|
||||
this.addClass = $('input#addClass');
|
||||
this.addGroup = $('input#addGroup');
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
this.select.change(function() {
|
||||
if ( classHierarchyUtils.select.val() == "all") {
|
||||
classHierarchyUtils.form.attr("action", "listVClassWebapps");
|
||||
}
|
||||
else if ( classHierarchyUtils.select.val() == "group") {
|
||||
classHierarchyUtils.form.attr("action", "listGroups");
|
||||
}
|
||||
|
||||
classHierarchyUtils.form.submit();
|
||||
});
|
||||
this.addClass.click(function() {
|
||||
classHierarchyUtils.form.attr("action", "vclass_retry");
|
||||
classHierarchyUtils.form.submit();
|
||||
});
|
||||
this.addGroup.click(function() {
|
||||
classHierarchyUtils.form.attr("action", "editForm?controller=Classgroup");
|
||||
classHierarchyUtils.form.submit();
|
||||
});
|
||||
|
||||
if ( this.displayOption == "group" ) {
|
||||
this.expandAll.click(function() {
|
||||
|
||||
if ( classHierarchyUtils.expandAll.text() == i18nStrings.hideSubclasses ) {
|
||||
$('td.subclassCell').parent('tr').hide();
|
||||
$('table.innerDefinition').hide();
|
||||
classHierarchyUtils.expandAll.text(i18nStrings.showSubclasses);
|
||||
}
|
||||
else {
|
||||
$('td.subclassCell').parent('tr').show();
|
||||
$('table.innerDefinition').show();
|
||||
classHierarchyUtils.expandAll.text(i18nStrings.hideSubclasses);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
buildClassHierarchyHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + classHierarchyUtils.classCounter
|
||||
});
|
||||
var descendants = "";
|
||||
var headerSpan = "";
|
||||
var closingTable = "</table>";
|
||||
|
||||
if ( this.children.length ) {
|
||||
descendants = classHierarchyUtils.getTheChildren(this);
|
||||
closingTable = "";
|
||||
headerSpan = "<span class='headerSpanPlus' id='headerSpan" + classHierarchyUtils.classCounter
|
||||
+ "' view='less'> </span>";
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += "<div>" + this.name + headerSpan + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ classHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
if ( this.data.shortDef.length > 0 ) {
|
||||
classHierarchyUtils.classHtml += "<tr><td colspan='2'>" + this.data.shortDef + "</td></tr>";
|
||||
}
|
||||
|
||||
if ( this.data.classGroup.length > 0 ) {
|
||||
classHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.classGroup + ":</td><td class='subclassCell'>" + this.data.classGroup + "</td></tr>";
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.ontologyString + ":</td><td class='subclassCell'>" + this.data.ontology + "</td></tr>";
|
||||
|
||||
|
||||
if ( descendants.length > 1 ) {
|
||||
descendants = descendants.substring(0, descendants.length - 10);
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += descendants;
|
||||
|
||||
classHierarchyUtils.classHtml += closingTable;
|
||||
// alert(classHierarchyUtils.classHtml);
|
||||
$newClassSection.html(classHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
classHierarchyUtils.makeHeaderSpansClickable(classHierarchyUtils.classCounter);
|
||||
classHierarchyUtils.makeSubclassSpansClickable();
|
||||
classHierarchyUtils.clickableSpans = [] ;
|
||||
classHierarchyUtils.classHtml = "";
|
||||
classHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
getTheChildren: function(node) {
|
||||
var childDetails = "";
|
||||
var subclassString = " ";
|
||||
var ctr = 0
|
||||
$.each(node.children, function() {
|
||||
if ( ctr == 0 ) {
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.subclassesString + ":</td>";
|
||||
ctr = ctr + 1;
|
||||
}
|
||||
else {
|
||||
childDetails += "<tr><td></td>" ;
|
||||
}
|
||||
|
||||
if ( this.children.length == 1 ) {
|
||||
subclassString += "<span style='font-size:0.8em'> (1 subclass)</span>";
|
||||
}
|
||||
else if ( this.children.length > 1 ) {
|
||||
subclassString += "<span style='font-size:0.8em'> (" + this.children.length + " subclasses)</span>";
|
||||
}
|
||||
childDetails += "<td class='subclassCell'><span class='subclassExpandPlus' id='subclassExpand"
|
||||
+ classHierarchyUtils.expandCounter + "'> </span>"
|
||||
+ this.name + subclassString + "</td></tr><tr><td></td><td><table id='subclassTable"
|
||||
+ classHierarchyUtils.expandCounter + "' class='subclassTable'>";
|
||||
subclassString = " ";
|
||||
classHierarchyUtils.clickableSpans.push('subclassExpand' + classHierarchyUtils.expandCounter);
|
||||
|
||||
classHierarchyUtils.expandCounter += 1;
|
||||
|
||||
if ( this.data.shortDef.length > 0 ) {
|
||||
childDetails += "<tr><td colspan='2'>" + this.data.shortDef + "</td></tr>";
|
||||
}
|
||||
|
||||
if ( this.data.classGroup.length > 0 ) {
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.classGroup + ":</td><td class='subclassCell'>" + this.data.classGroup + "</td></tr>";
|
||||
}
|
||||
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.ontologyString + ":</td><td class='subclassCell'>" + this.data.ontology + "</td></tr>";
|
||||
|
||||
if ( this.children ) {
|
||||
var grandChildren = classHierarchyUtils.getTheChildren(this);
|
||||
childDetails += grandChildren;
|
||||
}
|
||||
});
|
||||
childDetails += "</table></td></tr>";
|
||||
return childDetails;
|
||||
},
|
||||
|
||||
makeHeaderSpansClickable: function(ctr) {
|
||||
|
||||
var $clickableHeader = $('section#classContainer' + ctr).find('span.headerSpanPlus');
|
||||
|
||||
$clickableHeader.click(function() {
|
||||
if ( $clickableHeader.attr('view') == "less" ) {
|
||||
$clickableHeader.addClass("headerSpanMinus");
|
||||
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').addClass("subclassExpandMinus");
|
||||
$('table#classHierarchy' + ctr).find('table.subclassTable').show();
|
||||
$clickableHeader.attr('view', 'more' );
|
||||
}
|
||||
else {
|
||||
$clickableHeader.removeClass("headerSpanMinus");
|
||||
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
|
||||
$('table#classHierarchy' + ctr).find('table.subclassTable').hide();
|
||||
$clickableHeader.attr('view', 'less' );
|
||||
}
|
||||
});
|
||||
},// $('myOjbect').css('background-image', 'url(' + imageUrl + ')');
|
||||
|
||||
makeSubclassSpansClickable: function() {
|
||||
$.each(classHierarchyUtils.clickableSpans, function() {
|
||||
var currentSpan = this;
|
||||
var $clickableSpan = $('section#container').find('span#' + currentSpan);
|
||||
var $subclassTable = $('section#container').find('table#subclassTable' + currentSpan.replace("subclassExpand",""));
|
||||
|
||||
$clickableSpan.click(function() {
|
||||
if ( $subclassTable.is(':visible') ) {
|
||||
$subclassTable.hide();
|
||||
$subclassTable.find('table.subclassTable').hide();
|
||||
$subclassTable.find('span').removeClass("subclassExpandMinus");
|
||||
$clickableSpan.removeClass("subclassExpandMinus");
|
||||
}
|
||||
else {
|
||||
$subclassTable.show();
|
||||
$clickableSpan.addClass("subclassExpandMinus");
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
wireExpandLink: function() {
|
||||
this.expandAll.click(function() {
|
||||
if ( classHierarchyUtils.expandAll.text() == i18nStrings.expandAll ) {
|
||||
classHierarchyUtils.expandAll.text(i18nStrings.collapseAll);
|
||||
$('span.headerSpanPlus').addClass("headerSpanMinus");
|
||||
$('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus");
|
||||
$('table.classHierarchy').find('table.subclassTable').show();
|
||||
$('section#container').find('span.headerSpanPlus').attr('view','more');
|
||||
}
|
||||
else {
|
||||
classHierarchyUtils.expandAll.text(i18nStrings.expandAll);
|
||||
$('span.headerSpanPlus').removeClass("headerSpanMinus");
|
||||
$('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
|
||||
$('table.classHierarchy').find('table.subclassTable').hide();
|
||||
$('section#container').find('span.headerSpanPlus').attr('view','less');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
buildAllClassesHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + classHierarchyUtils.classCounter
|
||||
});
|
||||
|
||||
classHierarchyUtils.classHtml += "<div>" + this.name + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ classHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
if ( this.data.shortDef.length > 0 ) {
|
||||
classHierarchyUtils.classHtml += "<tr><td colspan='2'>" + this.data.shortDef + "</td></tr>";
|
||||
}
|
||||
|
||||
if ( this.data.classGroup.length > 0 ) {
|
||||
classHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.classGroup + ":</td><td>" + this.data.classGroup + "</td></tr>";
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.ontologyString + ":</td><td>" + this.data.ontology + "</td></tr>";
|
||||
|
||||
classHierarchyUtils.classHtml += "</table>";
|
||||
|
||||
$newClassSection.html(classHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
classHierarchyUtils.classHtml = "";
|
||||
classHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
},
|
||||
|
||||
buildClassGroupHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + classHierarchyUtils.classCounter
|
||||
});
|
||||
var descendants = "";
|
||||
|
||||
if ( this.children.length ) {
|
||||
var ctr = 0;
|
||||
$.each(this.children, function() {
|
||||
if ( ctr == 0 ) {
|
||||
descendants += "<tr><td class='classDetail'>" + i18nStrings.classesString + ":</td>";
|
||||
ctr = ctr + 1;
|
||||
}
|
||||
else {
|
||||
descendants += "<tr><td></td>" ;
|
||||
}
|
||||
|
||||
descendants += "<td class='subclassCell'>" + this.name + "</td></tr>";
|
||||
descendants += "<tr><td></td><td><table class='innerDefinition'><tr><td>" + this.data.shortDef + "</td></tr></table></td></tr>";
|
||||
|
||||
});
|
||||
descendants += "</table></td></tr>";
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += "<div>" + this.name + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ classHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
if ( this.data.displayRank.length > 0 ) {
|
||||
classHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.displayRank + ":</td><td>" + this.data.displayRank + "</td></tr>"
|
||||
}
|
||||
|
||||
classHierarchyUtils.classHtml += descendants;
|
||||
|
||||
classHierarchyUtils.classHtml += "</table>";
|
||||
$newClassSection.html(classHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
classHierarchyUtils.classHtml = "";
|
||||
classHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var fauxPropertiesListingUtils = {
|
||||
onLoad: function() {
|
||||
this.initObjects();
|
||||
this.bindEventListeners();
|
||||
},
|
||||
|
||||
initObjects: function() {
|
||||
this.select = $('select#displayOption');
|
||||
this.theForm = $('form#fauxListing');
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
this.select.change(function() {
|
||||
fauxPropertiesListingUtils.theForm.submit();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,380 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var objectPropHierarchyUtils = {
|
||||
onLoad: function(urlBase,displayOption,type) {
|
||||
$.extend(this, i18nStrings);
|
||||
this.imagePath = urlBase + "/images/";
|
||||
this.propType = type;
|
||||
this.initObjects();
|
||||
this.expandAll.hide();
|
||||
// this.toggleDiv.hide();
|
||||
this.checkJsonTree();
|
||||
|
||||
if ( noProps ) {
|
||||
this.buildNoPropsHtml();
|
||||
}
|
||||
else if ( displayOption == "all" ) {
|
||||
this.buildAllPropsHtml();
|
||||
}
|
||||
else if ( displayOption == "group" ) {
|
||||
this.buildPropertyGroupHtml();
|
||||
}
|
||||
else {
|
||||
this.buildPropertyHierarchyHtml();
|
||||
this.wireExpandLink();
|
||||
}
|
||||
|
||||
if ( displayOption == "hierarchy" || displayOption == "group") {
|
||||
this.expandAll.show();
|
||||
}
|
||||
// else if ( displayOption == "group" ) {
|
||||
// this.toggleDiv.show();
|
||||
// }
|
||||
this.bindEventListeners();
|
||||
},
|
||||
|
||||
initObjects: function() {
|
||||
this.expandAll = $('span#expandAll').find('a');
|
||||
this.classCounter = 1;
|
||||
this.expandCounter = 1;
|
||||
this.classHtml = "";
|
||||
this.clickableSpans = [] ;
|
||||
this.form = $('form#classHierarchyForm');
|
||||
this.select = $('select#displayOption');
|
||||
this.addProperty = $('input#addProperty');
|
||||
// this.toggleDiv = $('div#propsToggleDiv');
|
||||
// this.toggleSpan = $('span#propsToggle');
|
||||
// this.toggleLink = $('span#propsToggle').find('a');
|
||||
noProps = new Boolean;
|
||||
this.range = ""
|
||||
if ( propertyType == "object" ) {
|
||||
this.range = i18nStrings.rangeClass;
|
||||
}
|
||||
else {
|
||||
this.range = i18nStrings.rangeDataType;
|
||||
}
|
||||
},
|
||||
|
||||
bindEventListeners: function() {
|
||||
if ( this.propType == "object" ) {
|
||||
this.select.change(function() {
|
||||
if ( objectPropHierarchyUtils.select.val() == "all" ) {
|
||||
objectPropHierarchyUtils.form.attr("action", "listPropertyWebapps");
|
||||
}
|
||||
else if ( objectPropHierarchyUtils.select.val() == "hierarchy") {
|
||||
objectPropHierarchyUtils.form.attr("action", "showObjectPropertyHierarchy");
|
||||
}
|
||||
else {
|
||||
objectPropHierarchyUtils.form.attr("action", "listPropertyGroups");
|
||||
}
|
||||
objectPropHierarchyUtils.form.submit();
|
||||
});
|
||||
|
||||
this.addProperty.click(function() {
|
||||
objectPropHierarchyUtils.form.attr("action", "editForm?controller=Property");
|
||||
objectPropHierarchyUtils.form.submit();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.select.change(function() {
|
||||
if ( objectPropHierarchyUtils.select.val() == "all" ) {
|
||||
objectPropHierarchyUtils.form.attr("action", "listDatatypeProperties");
|
||||
}
|
||||
else if ( objectPropHierarchyUtils.select.val() == "hierarchy" ) {
|
||||
objectPropHierarchyUtils.form.attr("action", "showDataPropertyHierarchy");
|
||||
}
|
||||
else {
|
||||
objectPropHierarchyUtils.form.attr("action", "listPropertyGroups");
|
||||
}
|
||||
objectPropHierarchyUtils.form.submit();
|
||||
});
|
||||
|
||||
this.addProperty.click(function() {
|
||||
objectPropHierarchyUtils.form.attr("action", "editForm?controller=Dataprop");
|
||||
objectPropHierarchyUtils.form.submit();
|
||||
});
|
||||
}
|
||||
if ( this.propType == "group" ) {
|
||||
this.expandAll.click(function() {
|
||||
|
||||
if ( objectPropHierarchyUtils.expandAll.text() == i18nStrings.hideProperties ) {
|
||||
$('td.subclassCell').parent('tr').hide();
|
||||
objectPropHierarchyUtils.expandAll.text(i18nStrings.showProperties);
|
||||
}
|
||||
else {
|
||||
$('td.subclassCell').parent('tr').show();
|
||||
objectPropHierarchyUtils.expandAll.text(i18nStrings.hideProperties);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
checkJsonTree: function() {
|
||||
if ( json.length == 1 ) {
|
||||
$.each(json, function() {
|
||||
// check to see whether we have a 'no properties' message or an actual json tree
|
||||
if ( this.name.indexOf("properties") != -1 && this.data == undefined ) {
|
||||
noProps = true;
|
||||
}
|
||||
else {
|
||||
noProps = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
noProps = false;
|
||||
}
|
||||
},
|
||||
|
||||
buildPropertyHierarchyHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + objectPropHierarchyUtils.classCounter
|
||||
});
|
||||
var descendants = "";
|
||||
var headerSpan = "";
|
||||
var closingTable = "</table>";
|
||||
|
||||
if ( this.children.length ) {
|
||||
descendants = objectPropHierarchyUtils.getTheChildren(this);
|
||||
closingTable = "";
|
||||
headerSpan = "<span class='headerSpanPlus' id='headerSpan" + objectPropHierarchyUtils.classCounter
|
||||
+ "' view='less'> </span>";
|
||||
}
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<div>" + this.name + headerSpan + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ objectPropHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.localNameString + ":</td><td>"
|
||||
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.groupString + ":</td><td>"
|
||||
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.domainClass + ":</td><td>"
|
||||
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<span class='rangeClass'>" + objectPropHierarchyUtils.range + ":</span>"
|
||||
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
|
||||
|
||||
if ( descendants.length > 1 ) {
|
||||
descendants = descendants.substring(0, descendants.length - 10);
|
||||
}
|
||||
|
||||
objectPropHierarchyUtils.classHtml += descendants;
|
||||
|
||||
objectPropHierarchyUtils.classHtml += closingTable;
|
||||
// alert(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.html(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
objectPropHierarchyUtils.makeHeaderSpansClickable(objectPropHierarchyUtils.classCounter);
|
||||
objectPropHierarchyUtils.makeSubpropertySpansClickable();
|
||||
objectPropHierarchyUtils.clickableSpans = [] ;
|
||||
objectPropHierarchyUtils.classHtml = "";
|
||||
objectPropHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
},
|
||||
|
||||
getTheChildren: function(node) {
|
||||
var childDetails = "";
|
||||
var subclassString = " ";
|
||||
var ctr = 0
|
||||
$.each(node.children, function() {
|
||||
if ( ctr == 0 ) {
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.subProperties + ":</td>";
|
||||
ctr = ctr + 1;
|
||||
}
|
||||
else {
|
||||
childDetails += "<tr><td></td>" ;
|
||||
}
|
||||
|
||||
if ( this.children.length == 1 ) {
|
||||
subclassString += "<span style='font-size:0.8em'> (1 " + i18nStrings.subProperty + ")</span>";
|
||||
}
|
||||
else if ( this.children.length > 1 ) {
|
||||
subclassString += "<span style='font-size:0.8em'> (" + this.children.length + " " + i18nStrings.subProperties + ")</span>";
|
||||
}
|
||||
|
||||
childDetails += "<td class='subclassCell' colspan='2'><span class='subclassExpandPlus' id='subclassExpand"
|
||||
+ objectPropHierarchyUtils.expandCounter + "'> </span>"
|
||||
+ this.name + subclassString + "</td></tr><tr><td></td><td colspan='2'><table id='subclassTable"
|
||||
+ objectPropHierarchyUtils.expandCounter + "' class='subclassTable'>";
|
||||
|
||||
subclassString = " ";
|
||||
|
||||
objectPropHierarchyUtils.clickableSpans.push('subclassExpand' + objectPropHierarchyUtils.expandCounter);
|
||||
|
||||
objectPropHierarchyUtils.expandCounter += 1;
|
||||
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.localNameString + ":</td><td>"
|
||||
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
|
||||
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.groupString + ":</td><td>"
|
||||
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
|
||||
|
||||
childDetails += "<tr><td class='classDetail'>" + i18nStrings.domainClass + ":</td><td>"
|
||||
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
|
||||
|
||||
childDetails += "<span class='rangeClass'>" + objectPropHierarchyUtils.range + ":</span>"
|
||||
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
|
||||
|
||||
if ( this.children ) {
|
||||
var grandChildren = objectPropHierarchyUtils.getTheChildren(this);
|
||||
childDetails += grandChildren;
|
||||
}
|
||||
});
|
||||
childDetails += "</table></td></tr>";
|
||||
return childDetails;
|
||||
},
|
||||
|
||||
makeHeaderSpansClickable: function(ctr) {
|
||||
|
||||
var $clickableHeader = $('section#classContainer' + ctr).find('span.headerSpanPlus');
|
||||
|
||||
$clickableHeader.click(function() {
|
||||
if ( $clickableHeader.attr('view') == "less" ) {
|
||||
$clickableHeader.addClass("headerSpanMinus");
|
||||
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').addClass("subclassExpandMinus");
|
||||
$('table#classHierarchy' + ctr).find('table.subclassTable').show();
|
||||
$clickableHeader.attr('view', 'more' );
|
||||
}
|
||||
else {
|
||||
$clickableHeader.removeClass("headerSpanMinus");
|
||||
$('table#classHierarchy' + ctr).find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
|
||||
$('table#classHierarchy' + ctr).find('table.subclassTable').hide();
|
||||
$clickableHeader.attr('view', 'less' );
|
||||
}
|
||||
});
|
||||
},// $('myOjbect').css('background-image', 'url(' + imageUrl + ')');
|
||||
|
||||
makeSubpropertySpansClickable: function() {
|
||||
$.each(objectPropHierarchyUtils.clickableSpans, function() {
|
||||
var currentSpan = this;
|
||||
var $clickableSpan = $('section#container').find('span#' + currentSpan);
|
||||
var $subclassTable = $('section#container').find('table#subclassTable' + currentSpan.replace("subclassExpand",""));
|
||||
|
||||
$clickableSpan.click(function() {
|
||||
if ( $subclassTable.is(':visible') ) {
|
||||
$subclassTable.hide();
|
||||
$subclassTable.find('table.subclassTable').hide();
|
||||
$subclassTable.find('span').removeClass("subclassExpandMinus");
|
||||
$clickableSpan.removeClass("subclassExpandMinus");
|
||||
}
|
||||
else {
|
||||
$subclassTable.show();
|
||||
$clickableSpan.addClass("subclassExpandMinus");
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
wireExpandLink: function() {
|
||||
this.expandAll.click(function() {
|
||||
if ( objectPropHierarchyUtils.expandAll.text() == i18nStrings.expandAll ) {
|
||||
objectPropHierarchyUtils.expandAll.text(i18nStrings.collapseAll);
|
||||
$('span.headerSpanPlus').addClass("headerSpanMinus");
|
||||
$('table.classHierarchy').find('span.subclassExpandPlus').addClass("subclassExpandMinus");
|
||||
$('table.classHierarchy').find('table.subclassTable').show();
|
||||
$('section#container').find('span.headerSpanPlus').attr('view','more');
|
||||
}
|
||||
else {
|
||||
objectPropHierarchyUtils.expandAll.text(i18nStrings.expandAll);
|
||||
$('span.headerSpanPlus').removeClass("headerSpanMinus");
|
||||
$('table.classHierarchy').find('span.subclassExpandPlus').removeClass("subclassExpandMinus");
|
||||
$('table.classHierarchy').find('table.subclassTable').hide();
|
||||
$('section#container').find('span.headerSpanPlus').attr('view','less');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
buildAllPropsHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + objectPropHierarchyUtils.classCounter
|
||||
});
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<div>" + this.name + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ objectPropHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.localNameString + ":</td><td>"
|
||||
+ (this.data.internalName.length > 0 ? this.data.internalName : "none" ) + "</td></tr>";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.groupString + ":</td><td>"
|
||||
+ (this.data.group.length > 0 ? this.data.group : "unspecified" ) + "</td></tr>";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.domainClass + ":</td><td>"
|
||||
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<span class='rangeClass'>" + objectPropHierarchyUtils.range + ":</span>"
|
||||
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + "</td></tr>";
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "</table>";
|
||||
|
||||
$newClassSection.html(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
objectPropHierarchyUtils.classHtml = "";
|
||||
objectPropHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
},
|
||||
|
||||
buildNoPropsHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + objectPropHierarchyUtils.classCounter
|
||||
});
|
||||
|
||||
objectPropHierarchyUtils.classHtml = "<h4>" + this.name + "</h4>";
|
||||
$newClassSection.html(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
objectPropHierarchyUtils.classHtml = "";
|
||||
});
|
||||
},
|
||||
|
||||
buildPropertyGroupHtml: function() {
|
||||
|
||||
$.each(json, function() {
|
||||
$newClassSection = jQuery("<section></section>", {
|
||||
id: "classContainer" + objectPropHierarchyUtils.classCounter
|
||||
});
|
||||
var descendants = "";
|
||||
|
||||
if ( this.children.length ) {
|
||||
var ctr = 0;
|
||||
$.each(this.children, function() {
|
||||
if ( ctr == 0 ) {
|
||||
descendants += "<tr><td class='classDetail'>" + i18nStrings.propertiesString + ":</td>";
|
||||
ctr = ctr + 1;
|
||||
}
|
||||
else {
|
||||
descendants += "<tr><td></td>" ;
|
||||
}
|
||||
|
||||
descendants += "<td class='subclassCell'>" + this.name + "</td></tr>";
|
||||
// descendants += "<tr><td></td><td><table class='innerDefinition'><tr><td>" + this.data.shortDef + "</td></tr></table></td></tr>";
|
||||
|
||||
});
|
||||
descendants += "</table></td></tr>";
|
||||
}
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "<div>" + this.name + "</div>" + "<table class='classHierarchy' id='classHierarchy"
|
||||
+ objectPropHierarchyUtils.classCounter + "'>" ;
|
||||
|
||||
if ( this.data.displayRank.length > 0 ) {
|
||||
objectPropHierarchyUtils.classHtml += "<tr><td class='classDetail'>" + i18nStrings.displayRank + ":</td><td>" + this.data.displayRank + "</td></tr>"
|
||||
}
|
||||
|
||||
objectPropHierarchyUtils.classHtml += descendants;
|
||||
|
||||
objectPropHierarchyUtils.classHtml += "</table>";
|
||||
// alert(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.html(objectPropHierarchyUtils.classHtml);
|
||||
$newClassSection.appendTo($('section#container'));
|
||||
objectPropHierarchyUtils.classHtml = "";
|
||||
objectPropHierarchyUtils.classCounter += 1;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
/*Display bubble message letting the user knows that it is necessary to create class groups and associate classes with class groups when there is no individual classes to select in Data Input section and
|
||||
hide it when there are classes*/
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var classesInSelectList = $('#addIndividualClass option').length;
|
||||
|
||||
if (classesInSelectList == 0) {
|
||||
$('#addIndividualClass input[type="submit"]').css('opacity','.4').click(function(event){
|
||||
event.preventDefault();
|
||||
$('#addClassBubble').effect( "shake", {times:2, direction:"up", distance:5}, 50 );
|
||||
});
|
||||
|
||||
$('#VClassURI').css('width','150px');
|
||||
|
||||
$('#addClassBubble').show();
|
||||
|
||||
}else{
|
||||
$('#addIndividualClass input[type="submit"]').removeClass('opacity');
|
||||
|
||||
$('#VClassURI').removeClass('width');
|
||||
|
||||
$('.long-options').css('width','300px');
|
||||
|
||||
$('#addClassBubble').hide();
|
||||
}
|
||||
});
|
1785
webapp/web/js/sparql/prototype.js
vendored
|
@ -1,407 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
var namespaces = {
|
||||
// now handled in GetAllPrefix.java
|
||||
// rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
||||
// rdfs : "http://www.w3.org/2000/01/rdf-schema#",
|
||||
// xsd : "http://www.w3.org/2001/XMLSchema#",
|
||||
// owl : "http://www.w3.org/2002/07/owl#",
|
||||
// swrl : "http://www.w3.org/2003/11/swrl#",
|
||||
// swrlb : "http://www.w3.org/2003/11/swrlb#",
|
||||
// vitro : "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#"
|
||||
};
|
||||
|
||||
var level = 0;
|
||||
|
||||
function init(){
|
||||
var url = "getAllClasses";
|
||||
var preurl = "getAllPrefix";
|
||||
|
||||
var base = document.getElementById("subject(0,0)");
|
||||
base.level = 0;
|
||||
base.count = 0;
|
||||
var myAjax = new Ajax.Request( url, {method: "get", parameters: "", onComplete: function(originalRequest){
|
||||
var response = originalRequest.responseXML;
|
||||
var options = response.getElementsByTagName("option");
|
||||
// if (options == null || options.length == 0){
|
||||
// alert("Error: Cannot get all the classes.");
|
||||
// return;
|
||||
// }
|
||||
for(i=0; i<options.length; i++){
|
||||
base[base.length] = new Option(options[i].childNodes[0].firstChild.data, options[i].childNodes[1].firstChild.data);
|
||||
}
|
||||
|
||||
var subdiv = document.getElementById("subject(0)");
|
||||
subdiv.appendChild(document.createElement("br"));
|
||||
|
||||
|
||||
var addprop = document.createElement("input");
|
||||
addprop.type = "button";
|
||||
addprop.value = "Add Property";
|
||||
addprop.level = 0;
|
||||
addprop.onclick = function() {
|
||||
return getProperty(this);
|
||||
}
|
||||
subdiv.appendChild(addprop);
|
||||
level ++;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
var myPrefixAjax = new Ajax.Request( preurl, {method: "get", parameters: "", onComplete: function(originalRequest){
|
||||
var response = originalRequest.responseXML;
|
||||
var options = response.getElementsByTagName("option");
|
||||
if (options == null || options.length == 0) {
|
||||
alert("Error: Cannot get all the prefixes.");
|
||||
return;
|
||||
}
|
||||
for(i=0; i<options.length; i++)
|
||||
namespaces[options[i].childNodes[0].firstChild.data] = options[i].childNodes[1].firstChild.data;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function getProperty(addprop){
|
||||
|
||||
var url = "getClazzAllProperties";
|
||||
var base = document.getElementById("subject(" + addprop.level + ",0)");
|
||||
var subject = base.value;
|
||||
if (subject == ""){
|
||||
alert("Please select a class.");
|
||||
}
|
||||
else{
|
||||
var params = "vClassURI=" + subject.replace('#', '%23');
|
||||
var myAjax = new Ajax.Request( url, {method: "get", parameters: params, onComplete: function(originalRequest){
|
||||
var response = originalRequest.responseXML;
|
||||
var property = document.createElement("select");
|
||||
property.id = "predicate(" + base.level + "," + base.count + ")";
|
||||
property[property.length] = new Option("Properties", "");
|
||||
var options = response.getElementsByTagName('option');
|
||||
if (options == null || options.length == 0){
|
||||
alert("Error: Cannot get data properties for " + subject + ".");
|
||||
return;
|
||||
}
|
||||
for(i=0; i<options.length; i++){
|
||||
property[property.length] = new Option(options[i].childNodes[0].firstChild.data, options[i].childNodes[1].firstChild.data + options[i].childNodes[2].firstChild.data);
|
||||
}
|
||||
property.level = base.level;
|
||||
property.count = base.count;
|
||||
|
||||
property.onchange = function() {
|
||||
return getObject(this);
|
||||
}
|
||||
|
||||
var prediv = document.getElementById("predicate(" + base.level + ")");
|
||||
|
||||
if (prediv.innerHTML.trim() != "") {
|
||||
var lastNode = prediv.lastChild.previousSibling;
|
||||
if (lastNode.selectedIndex == 0){
|
||||
alert("You have a undefined property, please make sure it has been initialized.");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
prediv.appendChild(property);
|
||||
|
||||
base.count += 1
|
||||
prediv.appendChild(document.createElement("br"));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getObject(property){
|
||||
var url = "getObjectClasses";
|
||||
|
||||
var base = document.getElementById("subject(" + property.level + ",0)")
|
||||
var subject = base.value;
|
||||
|
||||
//Disable the selection
|
||||
property.disabled = true;
|
||||
|
||||
//DEL PROPERTY
|
||||
var delprop = document.createElement("input");
|
||||
delprop.type = "button";
|
||||
delprop.value = "Delete";
|
||||
delprop.count = base.count - 1;
|
||||
delprop.level = base.level;
|
||||
delprop.onclick = function() {
|
||||
return delProperty(this);
|
||||
}
|
||||
var prediv = document.getElementById("predicate(" + base.level + ")");
|
||||
prediv.insertBefore(delprop, property.nextSibling);
|
||||
|
||||
|
||||
var predicate = property.value;
|
||||
var type = predicate.charAt(predicate.length-1);
|
||||
predicate = predicate.substring(0, predicate.length-1);
|
||||
if (type == '0') {
|
||||
var objdiv = document.getElementById("object(" + base.level + ")");
|
||||
var dataprop = document.createElement("input");
|
||||
dataprop.type = "text";
|
||||
dataprop.size = 50;
|
||||
dataprop.count = base.count - 1;
|
||||
dataprop.level = base.level;
|
||||
dataprop.id = "object(" + base.level + "," + (base.count - 1) + ")";
|
||||
objdiv.appendChild(dataprop);
|
||||
objdiv.appendChild(document.createElement("br"));
|
||||
}
|
||||
else{
|
||||
var params = "predicate=" + predicate.replace('#', '%23');
|
||||
|
||||
var myAjax = new Ajax.Request( url, {method: "get", parameters: params, onComplete: function(originalRequest){
|
||||
var response = originalRequest.responseXML;
|
||||
var objdiv = document.getElementById("object(" + base.level + ")");
|
||||
var options = response.getElementsByTagName('option');
|
||||
if (options == null || options.length == 0){
|
||||
alert("Error: Cannot get range classes for " + predicate + ".");
|
||||
return;
|
||||
}
|
||||
var obj = document.getElementById("object(" + base.level + "," + base.count + ")");
|
||||
if (obj == null){
|
||||
if (options.length > 0){
|
||||
obj = document.createElement("select");
|
||||
obj[obj.length] = new Option("Classes", "");
|
||||
for(i=0; i<options.length; i ++){
|
||||
obj[obj.length] = new Option(options[i].childNodes[0].firstChild.data, options[i].childNodes[1].firstChild.data);
|
||||
}
|
||||
obj.onchange = function(){
|
||||
return addClass(this);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
obj = document.createElement("input");
|
||||
obj.type = "text";
|
||||
}
|
||||
obj.id = "object(" + base.level + "," + (base.count - 1) + ")";
|
||||
|
||||
obj.level = base.level;
|
||||
obj.count = base.count - 1;
|
||||
objdiv.appendChild(obj);
|
||||
objdiv.appendChild(document.createElement("br"));
|
||||
}
|
||||
else{
|
||||
var objpar = obj.parentNode;
|
||||
|
||||
if (options.length > 0){
|
||||
var newobj = document.createElement("select");
|
||||
newobj[newobj.length] = new Option("Classes", "");
|
||||
for(i=0; i<options.length; i ++){
|
||||
newobj[newobj.length] = new Option(options[i].firstChild.data, options[i].firstChild.data);
|
||||
}
|
||||
newobj.onchange = function(){
|
||||
return addClass(this);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
newobj = document.createElement("input");
|
||||
newobj.type = "text";
|
||||
}
|
||||
newobj.id = "object(" + base.level + "," + base.count + ")";
|
||||
|
||||
newobj.level = base.level;
|
||||
newobj.count = base.count;
|
||||
objpar.replaceChild(newobj, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function addClass(obj){
|
||||
addClazz();
|
||||
|
||||
//disable the selection
|
||||
obj.disabled = true;
|
||||
|
||||
var subject = document.createElement("select");
|
||||
|
||||
subject[subject.length] = new Option(obj.options[obj.selectedIndex].text, obj.value);
|
||||
subject.disabled = true;
|
||||
subject.level = level;
|
||||
level ++;
|
||||
subject.count = 0;
|
||||
subject.id = "subject(" + subject.level + "," + subject.count + ")";
|
||||
|
||||
var subdiv = document.getElementById("subject(" + subject.level +")");
|
||||
subdiv.appendChild(subject);
|
||||
|
||||
var delclazz = document.createElement("input");
|
||||
delclazz.type = "button";
|
||||
delclazz.value = "Delete";
|
||||
delclazz.count = subject.count;
|
||||
delclazz.level = subject.level;
|
||||
delclazz.onclick = function() {
|
||||
return delClazz(this.level);
|
||||
}
|
||||
subdiv.appendChild(delclazz);
|
||||
subdiv.appendChild(document.createElement("br"));
|
||||
var addprop = document.createElement("input");
|
||||
addprop.type = "button";
|
||||
addprop.value = "Add Property";
|
||||
addprop.level = subject.level;
|
||||
addprop.onclick = function() {
|
||||
return getProperty(this);
|
||||
}
|
||||
subdiv.appendChild(addprop);
|
||||
|
||||
}
|
||||
|
||||
function addClazz(){
|
||||
var builder = document.getElementById("builder");
|
||||
|
||||
var clazz = document.createElement("tr");
|
||||
clazz.id = "clazz(" + level + ")";
|
||||
var subject = document.createElement("td");
|
||||
subject.id = "subject(" + level + ")";
|
||||
var predicate = document.createElement("td");
|
||||
predicate.id = "predicate(" + level + ")";
|
||||
var object = document.createElement("td");
|
||||
object.id = "object(" + level + ")";
|
||||
|
||||
clazz.appendChild(subject);
|
||||
clazz.appendChild(predicate);
|
||||
clazz.appendChild(object);
|
||||
|
||||
builder.appendChild(clazz);
|
||||
}
|
||||
|
||||
function delClazz(level){
|
||||
var clazz = document.getElementById("clazz(" + level +")");
|
||||
var builder = document.getElementById("builder");
|
||||
builder.removeChild(clazz);
|
||||
}
|
||||
|
||||
function delProperty(delprop){
|
||||
var sub = document.getElementById("predicate(" + delprop.level + "," + delprop.count + ")");
|
||||
var obj = document.getElementById("object(" + delprop.level + "," + delprop.count + ")");
|
||||
var subdiv = document.getElementById("predicate(" + delprop.level +")");
|
||||
var objdiv = document.getElementById("object(" + delprop.level +")");
|
||||
subdiv.removeChild(sub.nextSibling.nextSibling);
|
||||
subdiv.removeChild(sub.nextSibling);
|
||||
subdiv.removeChild(sub);
|
||||
|
||||
objdiv.removeChild(obj.nextSibling);
|
||||
objdiv.removeChild(obj);
|
||||
|
||||
}
|
||||
|
||||
function genQuery(){
|
||||
var items = new Array();
|
||||
var criterias = new Array();
|
||||
var clazz = new Array();
|
||||
var number = 0;
|
||||
var _sub;
|
||||
var _obj;
|
||||
|
||||
|
||||
// namespaces shown in the SPARQL query box
|
||||
var namespace = getNamespace();
|
||||
//var gid = 0;
|
||||
for (i=0; i < level; i++){
|
||||
var subjects = document.getElementById("subject(" + i + ")");
|
||||
if (subjects == null){
|
||||
continue;
|
||||
}
|
||||
var subNodes = subjects.getElementsByTagName("select");
|
||||
var sub = subNodes[0].value;
|
||||
|
||||
sub = getNameWithPrefix(sub);
|
||||
|
||||
if (!clazz[sub.substring(sub.indexOf(":") + 1)]){
|
||||
clazz[sub.substring(sub.indexOf(":") + 1)] = 1;
|
||||
_sub = sub.substring(sub.indexOf(":") + 1) + 1;
|
||||
}
|
||||
else{
|
||||
_sub = sub.substring(sub.indexOf(":") + 1) + clazz[sub.substring(sub.indexOf(":") + 1)];
|
||||
}
|
||||
var subname = "?" + _sub;
|
||||
//gid++;
|
||||
//criterias[criterias.length] = "GRAPH ?g" + gid + " { " + subname + " rdf:type " + sub + " . }";
|
||||
criterias[criterias.length] = subname + " rdf:type " + sub + " .";
|
||||
|
||||
|
||||
var predicates = document.getElementById("predicate(" + i + ")");
|
||||
var preNodes = predicates.getElementsByTagName("select");
|
||||
var num = preNodes.length;
|
||||
|
||||
for (j=0; j<num; j++){
|
||||
//gid++;
|
||||
var pre = preNodes[j];
|
||||
obj = document.getElementById("object(" + pre.level + "," + pre.count + ")");
|
||||
if (obj == null){
|
||||
alert("You have a undefined property, please make sure it has been initialized.");
|
||||
return;
|
||||
}
|
||||
pre = pre.value;
|
||||
pre = pre.substring(0, pre.length-1);
|
||||
pre = getNameWithPrefix(pre);
|
||||
if (obj.tagName == "INPUT"){
|
||||
var objname = subname + "_" + pre.substring(pre.indexOf(":") + 1);
|
||||
|
||||
//criterias[criterias.length] = "GRAPH ?g" + gid + " { " + subname + " " + pre + " " + objname + " . }";
|
||||
criterias[criterias.length] = subname + " " + pre + " " + objname + " .";
|
||||
items[items.length] = objname;
|
||||
if (obj.value != ""){
|
||||
criterias[criterias.length] = "FILTER REGEX (str(" + objname + "), '" + obj.value + "', 'i')";
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
obj = obj.value;
|
||||
obj = getNameWithPrefix(obj);
|
||||
if (!clazz[obj.substring(obj.indexOf(":") + 1)]){
|
||||
clazz[obj.substring(obj.indexOf(":") + 1)] = 1;
|
||||
_obj = obj.substring(obj.indexOf(":") + 1) + 1;
|
||||
}
|
||||
else{
|
||||
number = clazz[obj.substring(obj.indexOf(":") + 1)] + 1;
|
||||
clazz[obj.substring(obj.indexOf(":") + 1)] = number
|
||||
_obj = obj.substring(obj.indexOf(":") + 1) + number;
|
||||
}
|
||||
var objname = "?" + _obj;
|
||||
//criterias[criterias.length] = "GRAPH ?g" + gid + " { " + subname + " " + pre + " " + objname + " . }";
|
||||
criterias[criterias.length] = subname + " " + pre + " " + objname + " .";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (items.length == 0) {
|
||||
var item = "*"
|
||||
}
|
||||
else{
|
||||
var item = "distinct " + items.join(" ");
|
||||
}
|
||||
var criteria = criterias.join("\n");
|
||||
|
||||
var query = namespace+ "SELECT " + item + "\nWHERE{\n" + criteria + "\n}\n";
|
||||
var quediv = document.getElementById("sparqlquery");
|
||||
var quetextarea = document.getElementById("query");
|
||||
quediv.style.visibility = "visible";
|
||||
quetextarea.value = query;
|
||||
}
|
||||
|
||||
function getNamespace(){
|
||||
var namespace = "";
|
||||
for (key in namespaces){
|
||||
namespace += "PREFIX " + key + ": <" + namespaces[key] + ">\n";
|
||||
}
|
||||
namespace += "\n";
|
||||
return namespace;
|
||||
}
|
||||
function getNameWithPrefix(name){
|
||||
for (key in namespaces){
|
||||
var index = name.indexOf(namespaces[key]);
|
||||
if (index == 0){
|
||||
return key + ":" + name.slice(namespaces[key].length);
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
(function(c){var b,e,a=[],d=window;c.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});c.each(r,function(t,s){s.render()})}if(!d.tinymce&&!e&&(g=j.script_url)){e=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}d.tinyMCEPreInit=d.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!d.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");c.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}c.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;e=2;if(j.script_loaded){j.script_loaded()}o();c.each(a,function(q,r){r()})}})}else{if(e===1){a.push(o)}else{o()}}return p};c.extend(c.expr[":"],{tinymce:function(g){return !!(g.id&&"tinyMCE" in window&&tinyMCE.get(g.id))}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==b){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(d.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(d.tinymce)&&(l.is(":tinymce")))}var j={};c.each(["text","html","val"],function(n,l){var o=j[l]=c.fn[l],m=(l==="text");c.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==b){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent({save:true})):o.apply(c(v),q)});return r}}});c.each(["append","prepend"],function(n,m){var o=j[m]=c.fn[m],l=(m==="prepend");c.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==b){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});c.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=c.fn[l];c.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=c.fn.attr;c.fn.attr=function(o,q){var m=this,n=arguments;if((!o)||(o!=="value")||(!g(m))){if(q!==b){return j.attr.apply(m,n)}else{return j.attr.apply(m,n)}}if(q!==b){k.call(m.filter(":tinymce"),q);j.attr.apply(m.not(":tinymce"),n);return m}else{var p=m[0],l=h(p);return l?l.getContent({save:true}):j.attr.apply(c(p),n)}}}})(jQuery);
|
1
webapp/web/js/tiny_mce/langs/en.js
vendored
|
@ -1,504 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefuly about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
||||
.panel_wrapper div.current {height:80px;}
|
||||
#width {width:50px; vertical-align:middle;}
|
||||
#width2 {width:50px; vertical-align:middle;}
|
||||
#size {width:100px;}
|
|
@ -1 +0,0 @@
|
|||
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
|
|
@ -1,57 +0,0 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
|
||||
init : function(ed, url) {
|
||||
// Register commands
|
||||
ed.addCommand('mceAdvancedHr', function() {
|
||||
ed.windowManager.open({
|
||||
file : url + '/rule.htm',
|
||||
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
||||
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
// Register buttons
|
||||
ed.addButton('advhr', {
|
||||
title : 'advhr.advhr_desc',
|
||||
cmd : 'mceAdvancedHr'
|
||||
});
|
||||
|
||||
ed.onNodeChange.add(function(ed, cm, n) {
|
||||
cm.setActive('advhr', n.nodeName == 'HR');
|
||||
});
|
||||
|
||||
ed.onClick.add(function(ed, e) {
|
||||
e = e.target;
|
||||
|
||||
if (e.nodeName === 'HR')
|
||||
ed.selection.select(e);
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced HR',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
||||
})();
|
43
webapp/web/js/tiny_mce/plugins/advhr/js/rule.js
vendored
|
@ -1,43 +0,0 @@
|
|||
var AdvHRDialog = {
|
||||
init : function(ed) {
|
||||
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
|
||||
|
||||
w = dom.getAttrib(n, 'width');
|
||||
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
|
||||
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
|
||||
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
|
||||
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
|
||||
|
||||
h = '<hr';
|
||||
|
||||
if (f.size.value) {
|
||||
h += ' size="' + f.size.value + '"';
|
||||
st += ' height:' + f.size.value + 'px;';
|
||||
}
|
||||
|
||||
if (f.width.value) {
|
||||
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
|
||||
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
|
||||
}
|
||||
|
||||
if (f.noshade.checked) {
|
||||
h += ' noshade="noshade"';
|
||||
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
|
||||
}
|
||||
|
||||
if (ed.settings.inline_styles)
|
||||
h += ' style="' + tinymce.trim(st) + '"';
|
||||
|
||||
h += ' />';
|
||||
|
||||
ed.execCommand("mceInsertContent", false, h);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.requireLangPack();
|
||||
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
|
|
@ -1 +0,0 @@
|
|||
tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});
|
58
webapp/web/js/tiny_mce/plugins/advhr/rule.htm
vendored
|
@ -1,58 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advhr.advhr_desc}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/rule.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body role="application">
|
||||
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
||||
<tr role="group" aria-labelledby="width_label">
|
||||
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
||||
<td class="nowrap">
|
||||
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
||||
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
||||
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
||||
<option value="">px</option>
|
||||
<option value="%">%</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="size">{#advhr_dlg.size}</label></td>
|
||||
<td><select id="size" name="size">
|
||||
<option value="">{#advhr_dlg.normal}</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="noshade">{#advhr_dlg.noshade}</label></td>
|
||||
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
#src_list, #over_list, #out_list {width:280px;}
|
||||
.mceActionPanel {margin-top:7px;}
|
||||
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
||||
.checkbox {border:0;}
|
||||
.panel_wrapper div.current {height:305px;}
|
||||
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
||||
#align, #classlist {width:150px;}
|
||||
#width, #height {vertical-align:middle; width:50px; text-align:center;}
|
||||
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
|
||||
#class_list {width:180px;}
|
||||
input {width: 280px;}
|
||||
#constrain, #onmousemovecheck {width:auto;}
|
||||
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
|
|
@ -1 +0,0 @@
|
|||
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
|
|
@ -1,50 +0,0 @@
|
|||
/**
|
||||
* editor_plugin_src.js
|
||||
*
|
||||
* Copyright 2009, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://tinymce.moxiecode.com/license
|
||||
* Contributing: http://tinymce.moxiecode.com/contributing
|
||||
*/
|
||||
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
||||
init : function(ed, url) {
|
||||
// Register commands
|
||||
ed.addCommand('mceAdvImage', function() {
|
||||
// Internal image object like a flash placeholder
|
||||
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
||||
return;
|
||||
|
||||
ed.windowManager.open({
|
||||
file : url + '/image.htm',
|
||||
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
||||
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
||||
inline : 1
|
||||
}, {
|
||||
plugin_url : url
|
||||
});
|
||||
});
|
||||
|
||||
// Register buttons
|
||||
ed.addButton('image', {
|
||||
title : 'advimage.image_desc',
|
||||
cmd : 'mceAdvImage'
|
||||
});
|
||||
},
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced image',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
||||
})();
|
235
webapp/web/js/tiny_mce/plugins/advimage/image.htm
vendored
|
@ -1,235 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advimage_dlg.dialog_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js"></script>
|
||||
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
|
||||
<script type="text/javascript" src="js/image.js"></script>
|
||||
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
||||
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
||||
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
|
||||
<li id="appearance_tab" aria-controls="appearance_panel"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
|
||||
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{#advimage_dlg.general}</legend>
|
||||
|
||||
<table role="presentation" class="properties">
|
||||
<tr>
|
||||
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
||||
<td colspan="2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" aria-required="true" /></td>
|
||||
<td id="srcbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
|
||||
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
|
||||
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
|
||||
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{#advimage_dlg.preview}</legend>
|
||||
<div id="prev"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="appearance_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{#advimage_dlg.tab_appearance}</legend>
|
||||
|
||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
|
||||
<td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="baseline">{#advimage_dlg.align_baseline}</option>
|
||||
<option value="top">{#advimage_dlg.align_top}</option>
|
||||
<option value="middle">{#advimage_dlg.align_middle}</option>
|
||||
<option value="bottom">{#advimage_dlg.align_bottom}</option>
|
||||
<option value="text-top">{#advimage_dlg.align_texttop}</option>
|
||||
<option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
|
||||
<option value="left">{#advimage_dlg.align_left}</option>
|
||||
<option value="right">{#advimage_dlg.align_right}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td rowspan="6" valign="top">
|
||||
<div class="alignPreview">
|
||||
<img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
|
||||
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
||||
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
||||
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
||||
erat volutpat.
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr role="group" aria-labelledby="widthlabel">
|
||||
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
||||
<td class="nowrap">
|
||||
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
||||
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
||||
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
||||
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
||||
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
||||
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
||||
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
||||
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="class_list">{#class_name}</label></td>
|
||||
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
||||
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr>
|
||||
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
||||
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
||||
</tr> -->
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="advanced_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{#advimage_dlg.swap_image}</legend>
|
||||
|
||||
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
||||
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
||||
|
||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
||||
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
||||
<td id="onmouseoversrccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
||||
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
||||
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
||||
<td id="onmouseoutsrccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
||||
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{#advimage_dlg.misc}</legend>
|
||||
|
||||
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
||||
<option value="">{#not_set}</option>
|
||||
<option value="ltr">{#advimage_dlg.ltr}</option>
|
||||
<option value="rtl">{#advimage_dlg.rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
||||
<td>
|
||||
<input id="usemap" name="usemap" type="text" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
||||
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
||||
<td id="longdesccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|