1 | /** |
---|
2 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
3 | * @file proyectos_operativos_extra.js |
---|
4 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
5 | * Copyright 2011 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
6 | * |
---|
7 | * This program is free software; you can redistribute it and/or modify |
---|
8 | * it under the terms of the GNU General Public License as published by |
---|
9 | * the Free Software Foundation; either version 2 of the License, or |
---|
10 | * (at your option) any later version. |
---|
11 | * |
---|
12 | * This program is distributed in the hope that it will be useful, |
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | * GNU General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License |
---|
18 | * along with this program; if not, write to the Free Software |
---|
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
20 | * |
---|
21 | * @author Cenditel Merida - Msc. Juan Vizcarrondo |
---|
22 | * @date 2012-02-02 // (año-mes-dia) |
---|
23 | * @version 0.1 // (0.1) |
---|
24 | */ |
---|
25 | |
---|
26 | /* |
---|
27 | * Implementacion valores iniciales |
---|
28 | */ |
---|
29 | var proyectosOperativos = {}; |
---|
30 | Drupal.behaviors.proyectosOperativosExtra = function (context) { |
---|
31 | /* |
---|
32 | * Implementacion function $.number |
---|
33 | * basada en la libreria jQuery number plug-in 2.1.3 de Sam Sehnert |
---|
34 | * Copyright 2012, Digital Fusion |
---|
35 | * liberada bajo MIT license |
---|
36 | * http://www.teamdf.com/web/jquery-number-format-redux/196/ |
---|
37 | */ |
---|
38 | $.number = function( number, decimals, dec_point, thousands_sep ){ |
---|
39 | // Set the default values here, instead so we can use them in the replace below. |
---|
40 | thousands_sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep; |
---|
41 | dec_point = (typeof dec_point === 'undefined') ? '.' : dec_point; |
---|
42 | decimals = !isFinite(+decimals) ? 0 : Math.abs(decimals); |
---|
43 | // Work out the unicode representation for the decimal place and thousand sep. |
---|
44 | var u_dec = ('\\u'+('0000'+(dec_point.charCodeAt(0).toString(16))).slice(-4)); |
---|
45 | var u_sep = ('\\u'+('0000'+(thousands_sep.charCodeAt(0).toString(16))).slice(-4)); |
---|
46 | // Fix the number, so that it's an actual number. |
---|
47 | number = (number + '') |
---|
48 | .replace('\.', dec_point) // because the number if passed in as a float (having . as decimal point per definition) we need to replace this with the passed in decimal point character |
---|
49 | .replace(new RegExp(u_sep,'g'),'') |
---|
50 | .replace(new RegExp(u_dec,'g'),'.') |
---|
51 | .replace(new RegExp('[^0-9+\-Ee.]','g'),''); |
---|
52 | var n = !isFinite(+number) ? 0 : +number, |
---|
53 | s = '', |
---|
54 | toFixedFix = function (n, decimals) { |
---|
55 | var k = Math.pow(10, decimals); |
---|
56 | return '' + Math.round(n * k) / k; |
---|
57 | }; |
---|
58 | // Fix for IE parseFloat(0.55).toFixed(0) = 0; |
---|
59 | s = (decimals ? toFixedFix(n, decimals) : '' + Math.round(n)).split('.'); |
---|
60 | if (s[0].length > 3) { |
---|
61 | s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, thousands_sep); |
---|
62 | } |
---|
63 | if ((s[1] || '').length < decimals) { |
---|
64 | s[1] = s[1] || ''; |
---|
65 | s[1] += new Array(decimals - s[1].length + 1).join('0'); |
---|
66 | } |
---|
67 | return s.join(dec_point); |
---|
68 | } |
---|
69 | |
---|
70 | //modificar el stylo de las etiquetas |
---|
71 | $(".workflow_history caption").css({'text-align':'left'}); |
---|
72 | $(".workflow_history p").css({'font-weight':'bold'}); |
---|
73 | } |
---|