app/assets/javascripts/sufia.js in sufia-3.7.2 vs app/assets/javascripts/sufia.js in sufia-4.0.0.beta1
- old
+ new
@@ -1,55 +1,49 @@
-/*
-Copyright © 2012 The Pennsylvania State University
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
//= require jquery-ui-1.9.2/jquery.ui.core
//= require jquery-ui-1.9.2/jquery.ui.widget
//= require jquery-ui-1.9.2/jquery.ui.menu
//= require jquery-ui-1.9.2/jquery.ui.autocomplete
//= require jquery-ui-1.9.2/jquery.ui.position
//= require jquery-ui-1.9.2/jquery.ui.effect
//= require jquery-ui-1.9.2/jquery.ui.effect-highlight
-//= require bootstrap-dropdown
-//= require bootstrap-button
-//= require bootstrap-modal
-//= require bootstrap-collapse
-//= require bootstrap-tooltip
-//= require bootstrap-popover
-//= require bootstrap-tab
+//= require bootstrap/dropdown
+//= require bootstrap/button
+//= require bootstrap/modal
+//= require bootstrap/collapse
+//= require bootstrap/tooltip
+//= require bootstrap/popover
+//= require bootstrap/tab
//= require video
//= require audio.min
//= require jquery.validate
//= require swfobject
//= require ZeroClipboard.min
+//= require flot/excanvas
+//= require flot/jquery.flot
+//= require flot/jquery.flot.time
+//= require flot/jquery.flot.selection
+
//= require batch_edit
//= require terms_of_service
//= require sufia/fileupload
//= require sufia/permissions
//= require sufia/trophy
+//= require sufia/featured_works
//= require sufia/batch_select_all
//= require sufia/multiForm
//= require sufia/edit_metadata
//= require sufia/single_use_link
//= require sufia/audio
+//= require sufia/editor
//= require hydra/batch_select
//= require hydra_collections
+//= require browse_everything
+//= require jquery.blacklightTagCloud
+//= require nestable
// this needs to be after batch_select so that the form ids get setup correctly
//= require sufia/batch_edit
//over ride the blacklight default to submit
@@ -67,12 +61,11 @@
function notify_update_link() {
$('#notify_update_link').click();
}
-// short hand for $(document).ready();
-$(function() {
+Blacklight.onLoad(function() {
// set up global batch edit options to override the ones in the gem
window.batch_edits_options = { checked_label: "",unchecked_label: "",progress_label: "",status_label: "",css_class: "batch_toggle"};
setInterval(notify_update_link, 30*1000);
@@ -97,22 +90,18 @@
});
};
// show/hide more information on the dashboard when clicking
// plus/minus
- $('.icon-plus').on('click', function() {
+ $('.glyphicon-plus').on('click', function() {
+ var button = $(this);
//this.id format: "expand_NNNNNNNNNN"
- var a = this.id.split("expand_");
- if (a.length > 1) {
- var docId = a[1];
- $("#detail_"+docId).toggle();
- if( $("#detail_"+docId).is(":hidden") ) {
- $("#expand_"+docId).attr("class", "icon-plus icon-large");
- }
- else {
- $("#expand_"+docId).attr("class", "icon-minus icon-large");
- }
+ var array = this.id.split("expand_");
+ if (array.length > 1) {
+ var docId = array[1];
+ $("#detail_" + docId + " .expanded-details").slideToggle();
+ button.toggleClass('glyphicon-plus glyphicon-minus');
}
return false;
});
$('#add_descriptions').click(function() {
@@ -121,10 +110,18 @@
return false;
});
$("a[rel=popover]").click(function() { return false;});
+ /*
+ * Tag cloud(s)
+ */
+ $(".tagcloud").blacklightTagCloud({
+ size: {start: 0.9, end: 2.5, unit: 'em'},
+ cssHooks: {granularity: 15},
+ // color: {start: '#cde', end: '#f52'}
+ });
/*
* facets lists
*/
@@ -138,31 +135,31 @@
});
$(".sorts-dash").click(function(){
var itag =$(this).find('i');
toggle_icon(itag);
- sort = itag.attr('class') == "icon-caret-down" ? itag.attr('id')+' desc': itag.attr('id') +' asc';
+ sort = itag.attr('class') == "caret" ? itag.attr('id')+' desc' : itag.attr('id') +' asc';
$('#sort').val(sort).selected = true;
- $(".icon-refresh").parent().click();
+ $("#dashboard_sort_submit").click();
});
+
$(".sorts").click(function(){
var itag =$(this).find('i');
toggle_icon(itag);
- sort = itag.attr('class') == "icon-caret-down" ? itag.attr('id')+' desc': itag.attr('id');
+ sort = itag.attr('class') == "caret up" ? itag.attr('id')+' desc': itag.attr('id');
$('input[name="sort"]').attr('value', sort);
- $(".icon-search").parent().click();
+ $("#user_submit").click();
});
+
}); //closing function at the top of the page
-
-
/*
* begin functions
*/
function toggle_icon(itag){
- itag.toggleClass("icon-caret-down");
- itag.toggleClass("icon-caret-up");
+ itag.toggleClass("caret");
+ itag.toggleClass("caret up");
}
function preg_quote( str ) {
// http://kevin.vanzonneveld.net
// + original by: booeyOH