merge
This commit is contained in:
commit
da1b871481
86 files changed
+3209
-1258
No files matched your search
@@ -7,6 +7,7 @@
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require jquery-ui
|
||||
//= require jquery.form
|
||||
//= require jquery.tinyscrollbar
|
||||
//= require jquery.miniColors.min
|
||||
//= require bootstrap
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
function checkSwitch() {
|
||||
$(".groups").each(function() {
|
||||
$(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled")
|
||||
});
|
||||
// $(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
checkSwitch();
|
||||
$('.onoff').click(function () {
|
||||
if($(this).parents("h4").length==1) {
|
||||
$(this).parents(".map-block").toggleClass("disabled");
|
||||
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
|
||||
if($(this).parents(".map-block").hasClass("disabled")){
|
||||
$(this).text("OFF");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
}
|
||||
}
|
||||
if($(this).parents("legend").length==1) {
|
||||
$(this).toggleClass("disabled");
|
||||
$(this).parents("legend").next("div").toggleClass("hide");
|
||||
if($(this).parents("legend").next("div").hasClass("hide")){
|
||||
$(this).text("OFF");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
}
|
||||
checkSwitch();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
$(document).ready(function(){
|
||||
$(".status select").each(function (i) {
|
||||
$(this).change(function () {
|
||||
$(".status option:selected").eq(i).each(function () {
|
||||
if($(this).attr("value")=="alumna") {
|
||||
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
|
||||
}else{
|
||||
$(this).parents(".status").nextAll(".graduated").addClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,112 @@
|
||||
jQuery(document).ready(function($) {
|
||||
// Stuff to do as soon as the DOM is ready. Use $() w/o colliding with other libs;
|
||||
var current_textarea = {};
|
||||
var parent = null;
|
||||
var this_modal_window = null;
|
||||
var lang = <%= VALID_LOCALES.to_s %>;
|
||||
|
||||
$("textarea[func=input_unit]").each(function(){
|
||||
var id = $(this).attr("id");
|
||||
current_textarea[id] = $(this).val();
|
||||
})
|
||||
console.log(current_textarea);
|
||||
|
||||
// current_textarea['en'] = $("textarea[for=en]").val();
|
||||
// current_textarea['zh_tw'] = $("textarea[for=zh_tw]").val();
|
||||
|
||||
|
||||
|
||||
$("div.controls").on("click","a.edit-btn",function(){
|
||||
parent = $(this).parent();
|
||||
this_modal_window = $(this).parent().parent().parent().parent().find(".modal");
|
||||
|
||||
choosen_lang = $(this).parent().parent().find("ul li.active").attr("for");
|
||||
$(this).parents(".editMore").find(".modal_tab").removeClass("active in");
|
||||
$(this).parents(".editMore").find(".modal_tab[for="+choosen_lang+"]").addClass("active in");
|
||||
|
||||
$(this).parents(".editMore").find(".modal-body li").removeClass("active");
|
||||
$(this).parents(".editMore").find(".modal-body li[for="+choosen_lang+"]").addClass("active");
|
||||
// switch($(this).parent().parent().find("ul li.active a").attr("href")){
|
||||
// case ".tab1":
|
||||
|
||||
// $("#tab3").addClass("active in");
|
||||
// $(".modal-body li").eq(0).addClass("active");
|
||||
// break;
|
||||
// case ".tab2":
|
||||
// $("#tab4").addClass("active in");
|
||||
// $(".modal-body li").eq(1).addClass("active");
|
||||
// break;
|
||||
|
||||
|
||||
$.each(lang,function(i,value){
|
||||
// console.log(this_modal_window);
|
||||
var sa = parent.find("input.street_address_"+lang[i]).val();
|
||||
var city = parent.find("input.city_"+lang[i]).val();
|
||||
var county = parent.find("input.county_"+lang[i]).val();
|
||||
var zip = parent.find("input.zip_"+lang[i]).val();
|
||||
var country = parent.find("input.country_"+lang[i]).val();
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val(sa);
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=city]').val(city);
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=county]').val(county);
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=zip]').val(zip);
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=country]').val(country);
|
||||
var verify = sa + city + country +county + zip;
|
||||
|
||||
var combined = "";
|
||||
if(verify!="")
|
||||
combined = sa + "\n" + city + "\n" + county + "\n" + zip + "\n" + country+"\n";
|
||||
|
||||
var Text0 = parent.find("div."+lang[i]+" textarea[func=input_unit]").val();
|
||||
Text1 = Text0.replace(/(\r\n|\n|\r)/gm,"");
|
||||
var Text2 = combined;
|
||||
Text2 = Text2.replace(/(\r\n|\n|\r)/gm,"");
|
||||
|
||||
if(Text1 != Text2){
|
||||
this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val(Text0);
|
||||
this_modal_window.find("input").val("");
|
||||
}
|
||||
});
|
||||
});
|
||||
$("textarea[func=input_unit]").change(function(){
|
||||
var id = $(this).attr("id");
|
||||
var lang = $(this).attr("for");
|
||||
if(!parent)
|
||||
parent = $(this).parent().parent();
|
||||
console.log(current_textarea[id]);
|
||||
if(current_textarea[id] != $(this).val())
|
||||
parent.find("input.indicator_"+lang).val("true");
|
||||
else
|
||||
parent.find("input.indicator_"+lang).val("false");
|
||||
})
|
||||
|
||||
$(".address-edit").on("hidden",function(){
|
||||
$("#tab3").removeClass("active in");
|
||||
$("#tab4").removeClass("active in");
|
||||
$(".modal-body li").removeClass("active");
|
||||
$(".modal-body input, .modal-body textarea").val("");
|
||||
|
||||
})
|
||||
$(".bt-save").click(function(){
|
||||
for(i=0;i<2;i++){
|
||||
var sa = this_modal_window.find('.tab-content div[for='+lang[i]+'] textarea[func=street_address]').val();
|
||||
var city = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=city]').val();
|
||||
var county = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=county]').val();
|
||||
var zip = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=zip]').val();
|
||||
var country = this_modal_window.find('.tab-content div[for='+lang[i]+'] input[func=country]').val();
|
||||
parent.find("input.street_address_"+lang[i]).val(sa);
|
||||
parent.find("input.city_"+lang[i]).val(city);
|
||||
parent.find("input.county_"+lang[i]).val(county);
|
||||
parent.find("input.zip_"+lang[i]).val(zip);
|
||||
parent.find("input.country_"+lang[i]).val(country);
|
||||
var verify = sa + city + country +county + zip;
|
||||
var combined = "";
|
||||
if(verify!="")
|
||||
combined = sa + "\n" + city + "\n" + county + "\n" + zip + "\n" + country;
|
||||
parent.find("textarea[for="+lang[i]+"]").val(combined);
|
||||
parent.find("input.indicator_"+lang[i]).val("false");
|
||||
current_textarea[parent.find("textarea[for="+lang[i]+"]").attr("id")] = combined;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
// var $CloneTarget ;
|
||||
|
||||
function checkMultipleInput() {
|
||||
$(".multipleInput").each(function() {
|
||||
$(this).children('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
|
||||
});
|
||||
}
|
||||
function removeInput(){
|
||||
$(".removeInput").click(function (){
|
||||
$(this).parents(".controls").remove();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(document).ready(function(){
|
||||
var $modalNumber = 0;
|
||||
checkMultipleInput();
|
||||
removeInput();
|
||||
$(".addinput").click(function (){
|
||||
$modalNumber+=1;
|
||||
var $CloneTarget = $(this).parents(".controls").prev(".multipleInput").children('.controls:last');
|
||||
$(this).parents(".controls").prev(".multipleInput").append($CloneTarget.clone());
|
||||
class_to_be_removed = $(this).parents(".controls").prev(".multipleInput").attr("ext_class")
|
||||
// $(this).parents(".controls").prev(".multipleInput").children('.controls:last input').val("");
|
||||
$(this).parents(".controls").prev(".multipleInput").children('.controls:last').find('input').val('')
|
||||
|
||||
$(this).parents(".controls").prev(".multipleInput").children('.controls:last').find('.tab-pane').removeClass(class_to_be_removed).addClass("NewInput_"+$modalNumber)
|
||||
btn = $(this).parents(".controls").prev(".multipleInput").children('.controls:last').find(".nav.nav-pills li")
|
||||
$.each(btn,function(i,value){
|
||||
old_link = $(this).children("a").attr("href");
|
||||
$(this).children("a").attr("href",".NewInput_"+$modalNumber);
|
||||
});
|
||||
removeInput();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
})
|
||||
});
|
||||
@@ -2,6 +2,9 @@
|
||||
//harry
|
||||
//Inititialize function will initialize desktop
|
||||
|
||||
//callback-method will be called after desktop controlled ajax call;
|
||||
//container=true is the area where the view will be loaded
|
||||
|
||||
|
||||
$.extend($.expr[':'], {
|
||||
'containsi': function (elem, i, match, array) {
|
||||
@@ -82,7 +85,7 @@ var orbitDesktop = function(dom){
|
||||
$(".docklist a").click(function(){
|
||||
var target = $(this).attr("id");
|
||||
var url = $(this).attr("href");
|
||||
o.data_method = $(this).attr("data-method");
|
||||
o.data_method = $(this).attr("callback-method");
|
||||
if(o.currenthtml!=target){
|
||||
if(o.desktopData[o.currentface] == "undefined")
|
||||
o.desktopData[o.currentface] = "";
|
||||
@@ -95,47 +98,28 @@ var orbitDesktop = function(dom){
|
||||
$(o.contentHolder).empty().load(url,function(){
|
||||
if(typeof o.data_method != "undefined"){
|
||||
if(o.data_method != "")
|
||||
window.o[o.data_method](target,url,cache);
|
||||
window.o[o.data_method](target,url,cache);
|
||||
}
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"));
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]").trigger("click"));
|
||||
cache = true;
|
||||
if(typeof o.data_method != "undefined"){
|
||||
if(o.data_method != "")
|
||||
window.o[o.data_method](target,url,cache);
|
||||
window.o[o.data_method](target,url,cache);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
$('body').on({
|
||||
click: function(){
|
||||
if(!$(this).hasClass('active')){
|
||||
var sub_data_method = $(this).attr('data-method');
|
||||
if(sub_data_method){
|
||||
$("#panel_r").load($(this).attr("href"),function(){
|
||||
// o.simple_drop_down();
|
||||
|
||||
// o.tinyscrollbar_ext({
|
||||
// main: '.tinycanvas',
|
||||
// fill: '.s_grid_con'
|
||||
// })
|
||||
if(typeof o.data_method != "undefined"){
|
||||
if(o.data_method != ""){
|
||||
if(typeof sub_data_method != "undefined"){
|
||||
if(sub_data_method != ""){
|
||||
window.o[o.data_method][sub_data_method]();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$('.s_menu a').removeClass('thmc1 thmtxt active');
|
||||
$(this).addClass('thmc1 thmtxt active');
|
||||
}
|
||||
o.sub_menu_item($(this));
|
||||
return false;
|
||||
},
|
||||
mouseenter: function(){
|
||||
@@ -147,7 +131,23 @@ var orbitDesktop = function(dom){
|
||||
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
|
||||
$(this).switchClass(t,'admtxt',0);
|
||||
}
|
||||
},'.s_menu a');
|
||||
},'*[content-type=menu] a');
|
||||
|
||||
$("body").on("submit","form[type=ajax_form]",function(){
|
||||
var callback_method = $(this).attr("callback-method");
|
||||
var options = {
|
||||
success:function(responseText, statusText, xhr, $form){
|
||||
if(typeof callback_method != "undefined"){
|
||||
if(callback_method != ""){
|
||||
window.o[o.data_method][callback_method](responseText,statusText,xhr,$form);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$(this).ajaxSubmit(options);
|
||||
return false;
|
||||
})
|
||||
|
||||
$(window).resize(function(){
|
||||
var ww = $(window).width();
|
||||
$("img#thmbackground").attr({"width":ww});
|
||||
@@ -171,6 +171,26 @@ var orbitDesktop = function(dom){
|
||||
$fn_des.stop(true, true).fadeOut();
|
||||
});
|
||||
};
|
||||
this.sub_menu_item = function(dom){
|
||||
if(!dom.hasClass('active')){
|
||||
var sub_data_method = dom.attr('callback-method');
|
||||
if(sub_data_method){
|
||||
$("div[container=true]").load(dom.attr("href"),function(){
|
||||
if(typeof o.data_method != "undefined"){
|
||||
if(o.data_method != ""){
|
||||
if(typeof sub_data_method != "undefined"){
|
||||
if(sub_data_method != ""){
|
||||
window.o[o.data_method][sub_data_method]();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$('*[content-type=menu] a').removeClass('thmc1 thmtxt active');
|
||||
dom.addClass('thmc1 thmtxt active');
|
||||
}
|
||||
}
|
||||
|
||||
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
|
||||
if(!target)target = "desktop";
|
||||
@@ -806,6 +826,14 @@ var orbitDesktop = function(dom){
|
||||
|
||||
};
|
||||
this.initializeJournalPapers = function(target,url,cache){ // this init journal papers
|
||||
this.initializeJournalPapers.formCallback = function(data){
|
||||
if(data.success){
|
||||
o.notify(data.msg,"success");
|
||||
o.sub_menu_item($("div[content-type=menu] a").eq(0));
|
||||
}else{
|
||||
o.notify(data.msg,"alert");
|
||||
}
|
||||
}
|
||||
|
||||
this.initializeJournalPapers.list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
@@ -817,7 +845,6 @@ var orbitDesktop = function(dom){
|
||||
fill: '.list_t'
|
||||
})
|
||||
|
||||
|
||||
$("#journal_selection_options a").click(function(){
|
||||
switch($(this).attr("href")){
|
||||
case "all":
|
||||
@@ -849,10 +876,26 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
$("div[container=true]").on("click",".journal_paper_edit",function(){
|
||||
$.ajax({
|
||||
url : $(this).attr("href"),
|
||||
type : "get",
|
||||
success : function(data){
|
||||
var prev_data = $("div[container=true]").html();
|
||||
$("div[container=true]").html(data);
|
||||
$(".bt-cancel").click(function(){
|
||||
$("div[container=true]").html(prev_data);
|
||||
})
|
||||
}
|
||||
})
|
||||
return false;
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_p div#paper_list a").click(function(){
|
||||
$("#journal_p div#paper_list a.icon-check-empty").click(function(){
|
||||
if($(this).hasClass("icon-check-empty")){
|
||||
$(this).switchClass("icon-check-empty","icon-check",0);
|
||||
} else if($(this) .hasClass("icon-check")) {
|
||||
@@ -873,7 +916,7 @@ var orbitDesktop = function(dom){
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div></li>');
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
@@ -902,6 +945,7 @@ var orbitDesktop = function(dom){
|
||||
var img = $('<div class="list_t_des"><a href="'+file.url+'" target="_blank" ><img src="'+file.icon+'" />'+thistitle+'</a></div>');
|
||||
li.append(img);
|
||||
})
|
||||
li.append('<a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
@@ -920,7 +964,7 @@ var orbitDesktop = function(dom){
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div></li>');
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
@@ -940,7 +984,7 @@ var orbitDesktop = function(dom){
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div></li>');
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
@@ -959,7 +1003,7 @@ var orbitDesktop = function(dom){
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div></li>');
|
||||
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a></li>');
|
||||
column.find("ul").append(li);
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
column = $('<div class="g_col list_t"><ul></ul></div>');
|
||||
@@ -969,11 +1013,14 @@ var orbitDesktop = function(dom){
|
||||
bindSecondaryHandlers();
|
||||
}
|
||||
|
||||
$.getJSON("/desktop/journal_pages/get_journals_json",function(journals){
|
||||
journalData = eval(journals);
|
||||
journalview();
|
||||
bindHandlers();
|
||||
})
|
||||
var getData = function(){
|
||||
$.getJSON("/desktop/journal_pages/get_journals_json",function(journals){
|
||||
journalData = eval(journals);
|
||||
journalview();
|
||||
bindHandlers();
|
||||
})
|
||||
}
|
||||
getData();
|
||||
}
|
||||
|
||||
this.initializeJournalPapers.addpaper = function(){ // to open add pages in journal papers page
|
||||
|
||||
Reference in new issue
Block a user