Commit 906ac729 authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Tomáš Peterka

slapos_web: Minor changes to make JSL happy.

parent f7429ef0
function selectCell(uid,additionnalClass,baseClass,listbox_id){ function selectCell(uid,additionnalClass,baseClass,listbox_id){
var checkbox = $("#"+listbox_id+"_cb_"+uid); var checkbox = $("#"+listbox_id+"_cb_"+uid);
var isChecked = checkbox.is(":checked"); var isChecked = checkbox.is(":checked");
//Uncheck all //Uncheck all
$("."+listbox_id+"-table :checked").attr("checked", false); $("."+listbox_id+"-table :checked").attr("checked", false);
$("."+listbox_id+"-table ."+baseClass).removeClass(additionnalClass); $("."+listbox_id+"-table ."+baseClass).removeClass(additionnalClass);
if (isChecked == false){ if (isChecked === false) {
//check the box which call the function //check the box which call the function
var cell = $("#"+listbox_id+"_cell_"+uid); var cell = $("#"+listbox_id+"_cell_"+uid);
cell.addClass(additionnalClass); cell.addClass(additionnalClass);
checkbox.attr("checked", true) checkbox.attr("checked", true);
} }
return isChecked == false; return isChecked === false;
} }
function selectSoftwareProduct(uid,additionnalClass,baseClass,listbox_id,product_url,from){ function selectSoftwareProduct(uid,additionnalClass,baseClass,listbox_id,product_url,from){
var isCallingBoxChecked = selectCell(uid,additionnalClass,baseClass,listbox_id); var isCallingBoxChecked = selectCell(uid,additionnalClass,baseClass,listbox_id);
if (isCallingBoxChecked == true){ if (isCallingBoxChecked === true){
release_listbox_url = product_url + "/SoftwareProduct_viewAsWeb/release_listbox?came_from=" + from ; release_listbox_url = product_url + "/SoftwareProduct_viewAsWeb/release_listbox?came_from=" + from ;
$("#release_listbox_container").load(release_listbox_url); $("#release_listbox_container").load(release_listbox_url);
} }
} }
String.prototype.startsWith = function(str) String.prototype.startsWith = function(str){
{return (this.match("^"+str)==str)} return (this.match("^"+str)==str);
};
function initCellSelction(additionnalClass,listbox_id) function initCellSelction(additionnalClass,listbox_id)
{ {
...@@ -40,22 +40,20 @@ function initCellSelction(additionnalClass,listbox_id) ...@@ -40,22 +40,20 @@ function initCellSelction(additionnalClass,listbox_id)
uid = id.substring(id_prefix.length,id.length); uid = id.substring(id_prefix.length,id.length);
//set the addtional css class //set the addtional css class
$("#listbox_cell_"+uid).addClass(additionnalClass); $("#listbox_cell_"+uid).addClass(additionnalClass);
} }
}); });
} }
function initSoftwareProductList(product_additionnal_class, product_listbox_id){ function initSoftwareProductList(product_additionnal_class, product_listbox_id){
//Select items //Select items
initCellSelction(product_additionnal_class,product_listbox_id) initCellSelction(product_additionnal_class,product_listbox_id);
//Show release selection //Show release selection
$("."+product_additionnal_class+":last").click() $("."+product_additionnal_class+":last").click();
} }
function clearField(selector,default_value) function clearField(selector,default_value)
{ {
var field = $(selector) var field = $(selector);
if (field.val() == default_value){ if (field.val() == default_value){
field.val(''); field.val('');
} }
......
...@@ -104,7 +104,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -104,7 +104,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// $(this).attr("class", "monitoring_failed"); // $(this).attr("class", "monitoring_failed");
var context = $(this); var context = $(this);
if (jqXHR.status === 404) { if (jqXHR.status === 404) {
context.remove() context.remove();
} else { } else {
$(this).attr("class", "monitoring_failed") $(this).attr("class", "monitoring_failed")
.attr("title", "Unable to fetch content"); .attr("title", "Unable to fetch content");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment