我正在使用bootstrap fileinput:
这是我的代码:
inputfile: function(id_usu){
var self = this;
$("#input_file_"+id_usu+"_id").fileinput({
'language': "es",
'showCancel': false,
'showUpload':true,
'previewFileType':'any',
'uploadLabel': "<strong style='color:rgb(65, 86, 62); font-weight: normal;'>Subir archivo</Strong>",
'uploadAsync': false,
'allowedFileExtensions': ["xls"],
'uploadIcon': '<i class="glyphicon glyphicon-upload" style="color:rgb(65, 86, 62);"></i>',
'uploadUrl' :"../../sistema/api/sistemaTareas/v1/subirarchivo",
'showPreview': false,
'elErrorContainer': '#kv_error_'+id_usu+'_2'
}).on('filebatchpreupload', function(event, data, id, index) {
$('#kv_success_'+id_usu+'_2').html('<h4>Estado:</h4><ul></ul>').hide();
}).on('filebatchuploadsuccess', function(event, data , previewId, index) {
var out = '';
$.each(data.files, function(key, file) {
console.info(data.response);
if(data.response == 1){
out = out + '<li>Se guardaron los datos con éxito.</li>';
}
if(data.response == 2){
out = out + '<li>El formato de archivo no es el correcto.</li>';
}
if(data.response == 3){
out = out + '<li>El archivo debe ser editable.</li>';
}
});
$('#kv_success_'+id_usu+'_2 ul').append(out);
$('#kv_success_'+id_usu+'_2').fadeIn('xslow');
window.setTimeout(function(){
$('#kv_success_'+id_usu+'_2').fadeOut('xslow');
}, 20000);
});
我需要修改messege的颜色:
我有这3条消息:
if(data.response == 1){
out = out + '<li>Se guardaron los datos con éxito.</li>';
}
if(data.response == 2){
out = out + '<li>El formato de archivo no es el correcto.</li>';
}
if(data.response == 3){
out = out + '<li>El archivo debe ser editable.</li>';
}
这3条消息就是这样的:
当消息是:
-Se guardaron losdatosconéxito。
背景颜色很好
但是当消息是:
或
我需要一种危险的背景颜色。
我该怎么做?
答案 0 :(得分:0)
也可以看到html(和css正在使用),但尝试这样的事情。通过截图,我假设正在使用Twitter Bootstrap。
import itertools
import numpy as np
from scipy import linalg
import matplotlib.pyplot as plt
import matplotlib as mpl
import pdb
from sklearn import mixture
# Generate 2D random sample, two gaussians each with 10000 points
rsamp1 = np.random.multivariate_normal(np.array([5.0,5.0]),np.array([[1.0,-0.2],[-0.2,1.0]]),10000)
rsamp2 = np.random.multivariate_normal(np.array([0.0,0.0]),np.array([[0.2,-0.0],[-0.0,3.0]]),10000)
X = np.concatenate((rsamp1,rsamp2),axis=0)
# Fit a mixture of Gaussians with EM using 2
gmm = mixture.GMM(n_components=2, covariance_type='full',n_iter=10000)
gmm.fit(X)
# Fit a Dirichlet process mixture of Gaussians using 10 components
dpgmm = mixture.DPGMM(n_components=10, covariance_type='full',min_covar=0.5,tol=0.00001,n_iter = 1000000)
dpgmm.fit(X)
print("Groups With data in them")
print(np.unique(dpgmm.predict(X)))
##print the input and output covars as example, should be very similar
correct_c0 = np.array([[1.0,-0.2],[-0.2,1.0]])
print "Input covar"
print correct_c0
covars = dpgmm._get_covars()
c0 = np.round(covars[0],decimals=1)
print "Output Covar"
print c0
print("Output Variances Too Big by 1.0")