From c009a3d66d598aeaa86191218cce3514e6b160c2 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Thu, 22 Oct 2009 04:06:43 +0000 Subject: archivos iniciales --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..a10136d --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Gonzalo Odiard godiard@gmail.com \ No newline at end of file diff --git a/ElementsActivity.py b/ElementsActivity.py new file mode 100644 index 0000000..62bee1d --- /dev/null +++ b/ElementsActivity.py @@ -0,0 +1,46 @@ +from sugar.activity import activity +from sugar import env +import os +import gtk +import gobject +import hulahop +hulahop.startup(os.path.join(env.get_profile_path(), 'gecko')) +from XOCom import XOCom + +class ElementsActivity (activity.Activity): + def __init__(self, handle): + activity.Activity.__init__(self, handle) + self.set_title('Elements') + + # The XOCom object helps us communicate with the browser + # This uses web/index.html as the default page to load + self.xocom = XOCom("file://"+os.path.join(os.path.dirname(os.path.abspath(__file__)),"web/allelements.xml")) + + toolbox = activity.ActivityToolbox(self) + self.set_toolbox(toolbox) + toolbox.show() + + self.set_canvas( self.xocom.create_webview() ) + + #self.read_file(os.path.join(os.path.dirname(os.path.abspath(__file__)),"datos.txt")) + + + def write_file(self, filename): + filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),"web/datos.js") + content = self.xocom.send_to_browser('write') + + if content: + fh = open(filename, 'w') + fh.write(content) + fh.close() + + def read_file(self, filename): + fh = open(filename, 'r') + content = fh.read() + def send_delayed_read(): + self.xocom.send_to_browser('read', content) + return False + # We must delay this to give the browser time to start up + # It would be better if this send_to_browser was instead triggered + # once the browser had finished loading. + gobject.timeout_add(5000, send_delayed_read) diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..b5c5f05 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,39 @@ +./ElementsActivity.py~ +./XOCom.py +./TODO +./info.txt~ +./info.txt +./po/ElementsActivity.pot +./datos.txt~ +./ElementsActivity.py +./web/utiles.js +./web/allelements.xml~ +./web/jquery.js +./web/tabla_elem.xsl~ +./web/tabla_elem.xsl +./web/datos.js +./web/datos.js~ +./web/xocom.js~ +./web/utiles.js~ +./web/xocom.js +./web/allelements.xml +./datos.txt +./AUTHORS +./setup.py +XOCom.py +TODO +info.txt +NEWS +ElementsActivity.py +datos.txt +AUTHORS +setup.py +po/ElementsActivity.pot +web/utiles.js +web/jquery.js +web/tabla_elem.xsl +web/datos.js +web/xocom.js +web/allelements.xml +activity/activity-elements.svg +activity/activity.info diff --git a/TODO b/TODO new file mode 100644 index 0000000..19a619f --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +* Conseguir imagenes de los elementos +* Links a Wikipedia o algo asi? +* Grabar en el Journal diff --git a/XOCom.py b/XOCom.py new file mode 100644 index 0000000..59d3b25 --- /dev/null +++ b/XOCom.py @@ -0,0 +1,73 @@ +from sugar.activity.activity import get_bundle_path +from hulahop.webview import WebView +from xpcom import components + +debug = True + +class XOCom: + # Constructor gives full XPCom access by default + # This should be improved for future apps that may not need/want full access + def __init__(self, uri=None): + if uri: + self.uri = uri + else: + self.uri = 'file://' + get_bundle_path() + '/web/index.html'; + self.give_full_xpcom_access() + + # Give the browser permission to use XPCom interfaces + # This is necessary for XPCom communication to work + # Note: Not all of these preferences may be required - requires further + # investigation + def give_full_xpcom_access(self): + pref_class = components.classes["@mozilla.org/preferences-service;1"] + prefs = pref_class.getService(components.interfaces.nsIPrefService) + prefs.getBranch('signed.applets.').setBoolPref('codebase_principal_support', + True); + prefs.getBranch('capability.principal.').setCharPref( + 'socialcalc.granted', 'UniversalXPConnect') + prefs.getBranch('capability.principal.').setCharPref( + 'socialcalc.id', self.uri) + + # Wrapper method to create a new webview embedded browser component + # Uses hulahop's WebView. Assumes that you'll want to serve + # web/index.html relative to your activity directory. + def create_webview(self): + web_view = WebView() + web_view.load_uri(self.uri) + web_view.show() + return web_view + + # Use XPCom to execute a javascript callback registered with XO.js + # The command will execute a javascript method registered with the same name, + # and return any value received from the javascript + def send_to_browser(self, command, parameter=None): + if debug: + print "sending: %s - (%s)"%(command, parameter) + + # Set up an array for parameters and return values for the XPCom call + array = components.classes["@mozilla.org/array;1"].createInstance( + components.interfaces.nsIMutableArray) + + # Optionally pass data to the javascript + if parameter: + str = components.classes["@mozilla.org/supports-string;1"].createInstance( + components.interfaces.nsISupportsString) + str.data = parameter + array.appendElement(str, False) + + # Use XPCom to send an event to a javascript observer (web/xo.js) + observerService = components.classes["@mozilla.org/observer-service;1"] + ob_serv = observerService.getService(components.interfaces.nsIObserverService); + ob_serv.notifyObservers(array, "xo-message", command); + + # check if the browser returned anything + result = None + if array.length: + iter = array.enumerate() + result = iter.getNext() + result = result.QueryInterface(components.interfaces.nsISupportsString) + result = result.toString() + + if debug: + print "result: %s - (%s)"%(command, result) + return result diff --git a/activity/activity-elements.svg b/activity/activity-elements.svg new file mode 100644 index 0000000..3fd905f --- /dev/null +++ b/activity/activity-elements.svg @@ -0,0 +1,60 @@ + + + + + + + +]> + + + + + diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..d9b6750 --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,7 @@ +[Activity] +name = ElementsActivity +service_name = com.Eq.Elements +class = ElementsActivity.ElementsActivity +icon = activity-elements +activity_version = 1 +show_launcher = yes diff --git a/info.txt b/info.txt new file mode 100644 index 0000000..e689fdd --- /dev/null +++ b/info.txt @@ -0,0 +1,5 @@ +http://en.wikipedia.org/wiki/Category:Chemical_elements_articles_by_quality +http://commons.wikimedia.org/wiki/Category:Chemical_elements +http://images-of-elements.com/ +http://www.educaplus.org/play.php?id=81&mcid=3 +http://es.wikipedia.org/wiki/Oxigeno diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..08a657d --- /dev/null +++ b/setup.py @@ -0,0 +1,18 @@ +#!/usr/bin/python + +# Make the MANIFEST file. The contents of the activity folder and the NEWS and MANIFEST +# files are already included in the .xo file which the bundlebuilder creates, so don't +# add them to the manifest file. +import os +os.system("find ./ -name 'activity' -prune -o -name 'NEWS' \ + -prune -o -name 'MANIFEST' \ + -prune -o -name '.svn' \ + -prune -o -name '*.pyc' \ + -prune -o -name '*.xo' \ + -prune -o -name '*.swp' \ + -prune -o -name '.git*' \ + -prune -o -type f \ + -print > MANIFEST") + +from sugar.activity import bundlebuilder +bundlebuilder.start("ElementsActivity") diff --git a/web/allelements.xml b/web/allelements.xml new file mode 100644 index 0000000..43ccdc0 --- /dev/null +++ b/web/allelements.xml @@ -0,0 +1,3593 @@ + + + + + + Actinium + Actinio2 + http://es.wikipedia.org/wiki/Actinio + 227 + 89 + 3 + 3470 + Ac + + 10.07 + + [Rn] 6d1 7s2 + 1.1 + 1.88 + + 22.5 + + + 0.12 + + 5.17 + + + + 12 + + + + + Aluminum + Aluminio3 + http://es.wikipedia.org/wiki/Aluminio + 26.98154 + 13 + 3 + 2740 + 933.5 + Al + + 2.7 + + [Ne] 3s2 p1 + 1.18 + 1.61 + 1.43 + + 290.8 + + + 10 + + + 10.7 + + 5.986 + + 0.9 + + + + 237 + + + + + Americium + Americio7 + http://es.wikipedia.org/wiki/Americio + 243 + 95 + 6, 5, 4, 3 + 2880 + 1449 + Am + + 13.7 + + [Rn] 5f7 7s2 + 1.3 + 1.84 + + 20.8 + + 6 + + + 10 + + + + + Antimony + Antimonio3 + http://es.wikipedia.org/wiki/Antimonio + 121.757 + 51 + +/-3, 5 + 1860 + 903.91 + Sb + + 6.69 + + [Kr] 4d10 5s2 p3 + 1.4 + 2.05 + 1.59 + + 67.97 + + + 18.4 + + + 19.83 + + 8.641 + + 0.207 + + + + 24.3 + + + + + Argón + Argon6 + http://es.wikipedia.org/wiki/Argon + 39.948 + 18 + 87.45 + 83.95 + Ar + + 1.784 + + [Ne] 3s2 p6 + 0.98 + 0 + 0.88 + + 6.506 + + + 24.2 + + + 1.188 + + 15.759 + + 0.52 + + + + 0.0177 + + + + + Arsenic + Arsénico4 + http://es.wikipedia.org/wiki/Arsenico + 74.9216 + 33 + +/-3, 5 + 876 + 1090 + As + + 5.78 + + [Ar] 3d10 4s2 p3 + 1.2 + 2.18 + 1.39 + + 32.4 + + + 13.1 + + + 27.7 + + 9.81 + + 0.33 + + + + 50 + + + + + Astatine + Astato4 + http://es.wikipedia.org/wiki/Astato + 210 + 85 + +/-1, 3, 5, 7 + 610 + 575 + At + [Xe] 4f14 5d10 6s2 p5 + 1.47 + 2.2 + 1.45 + + 30 + + + 12 + + + + 1.7 + + + + + Gold + Oro2 + http://es.wikipedia.org/wiki/Oro + 196.9665 + 79 + 3, 1 + 3130 + 1337.58 + Au + + 19.3 + + [Xe] 4f14 5d10 6s1 + 1.34 + 2.54 + 1.46 + + 324.43 + + + 10.2 + + + 12.36 + + 9.225 + + 0.128 + + + + 317 + + + + + Boron + Boro4 + http://es.wikipedia.org/wiki/Boro + 10.811 + 5 + 3 + 4275 + 2365 + B + + 2.34 + + 1s2 2s2 p1 + 0.82 + 2.04 + 0.98 + + 507.8 + + + 4.6 + + + 22.6 + + 8.298 + + 1.026 + + + + 27 + + + + + Barium + Bario1 + http://es.wikipedia.org/wiki/Bario + 137.33 + 56 + 2 + 2078 + 1002 + Ba + + 3.59 + + [Xe] 6s2 + 1.98 + 0.89 + 2.22 + + 140.2 + + + 39 + + + 8.01 + + 5.212 + + 0.204 + + + + 18.4 + + + + + Beryllium + Berilio1 + http://es.wikipedia.org/wiki/Berilio + 9.01218 + 4 + 2 + 3243 + 1560 + Be + + 1.85 + + 1s2 2s2 + 0.9 + 1.57 + 1.12 + + 297 + + + 5 + + + 11.71 + + 9.322 + + 1.825 + + + + 200 + + + + + Bohrium + Unnliseptium2 + http://es.wikipedia.org/wiki/Unnliseptium + 262 + 107 + Bh + [Rn] 5f14 6d5 7s2 + + + + Bismuth + Bismuto3 + http://es.wikipedia.org/wiki/Bismuto + 208.9804 + 83 + 3, 5 + 1837 + 544.59 + Bi + + 9.75 + + [Xe] 4f14 5d10 6s2 p3 + 1.46 + 2.02 + 1.7 + + 179 + + + 21.3 + + + 11 + + 7.289 + + 0.122 + + + + 7.87 + + + + + Berkelium + Berkelio7 + http://es.wikipedia.org/wiki/Berkelio + 247 + 97 + 4, 3 + Bk + [Rn] 5f9 7s2 + 1.3 + + 6.23 + + + 10 + + + + + Bromine + Bromo5 + http://es.wikipedia.org/wiki/Bromo + 79.904 + 35 + +/-1, 5 + 331.85 + 265.95 + Br + + 3.12 + + [Ar] 3d10 4s2 p5 + 1.14 + 2.96 + 1.12 + + 14.725 + + + 23.5 + + + 5.286 + + 11.814 + + 0.226 + + + + 0.122 + + + + + Carbon + Carbono5 + http://es.wikipedia.org/wiki/Carbono + 12.011 + 6 + +/-4, 2 + 5100 + 3825 + C + + 2.26 + + 1s2 2s2 p2 + 0.77 + 2.55 + 0.91 + + 715 + + + 5.3 + + 11.26 + + 0.709 + + + + 155 + + + + + Calcium + Calcio1 + http://es.wikipedia.org/wiki/Calcio + 40.078 + 20 + 2 + 1757 + 1112 + Ca + + 1.55 + + [Ar] 4s2 + 1.74 + 1 + 1.97 + + 154.67 + + + 29.9 + + + 8.53 + + 6.113 + + 0.647 + + + + 200 + + + + + Cadmium + Cadmio2 + http://es.wikipedia.org/wiki/Cadmio + 112.41 + 48 + 2 + 1040 + 594.26 + Cd + + 8.65 + + [Kr] 4d10 5s2 + 1.41 + 1.69 + 1.71 + + 99.87 + + + 13.1 + + + 6.07 + + 8.993 + + 0.233 + + + + 96.8 + + + + + Cerium + Cerio2 + http://es.wikipedia.org/wiki/Cerio + 140.12 + 58 + 3, 4 + 3715 + 1071 + Ce + + 6.77 + + [Xe] 4f1 5d1 6s2 + 1.65 + 1.12 + 1.81 + + 313.8 + + + 21 + + + 9.2 + + 5.47 + + 0.19 + + + + 11.4 + + + + + Californium + Californio7 + http://es.wikipedia.org/wiki/Californio + 251 + 98 + 3 + 1170 + Cf + [Rn] 5f10 7s2 + 1.3 + + 6.3 + + + 10 + + + + + Chlorine + Cloro5 + http://es.wikipedia.org/wiki/Cloro + 35.4527 + 17 + +/-1, 3, 5, 7 + 239.18 + 172.17 + Cl + + 3.214 + + [Ne] 3s2 p5 + 0.99 + 3.16 + 0.97 + + 10.2 + + + 18.7 + + + 3.21 + + 12.967 + + 0.48 + + + + 0.0089 + + + + + Curium + Curio7 + http://es.wikipedia.org/wiki/Curio + 247 + 96 + 3 + 1620 + Cm + + 13.5 + + [Rn] 5f7 6d1 7s2 + 1.3 + + 18.3 + + 6.02 + + + 10 + + + + + Cobalt + Cobalto2 + http://es.wikipedia.org/wiki/Cobalto + 58.9332 + 27 + 2, 3 + 3143 + 1768 + Co + + 8.9 + + [Ar] 3d7 4s2 + 1.16 + 1.88 + 1.25 + + 373.3 + + + 6.7 + + + 16.19 + + 7.86 + + 0.421 + + + + 100 + + + + + Chromium + Cromo2 + http://es.wikipedia.org/wiki/Cromo + 51.996 + 24 + 6, 3, 2 + 2945 + 2130 + Cr + + 7.19 + + [Ar] 3d5 4s1 + 1.18 + 1.66 + 1.3 + + 339.5 + + + 7.23 + + + 20 + + 6.766 + + 0.449 + + + + 93.7 + + + + + Cesium + Cesio1 + http://es.wikipedia.org/wiki/Cesio + 132.9054 + 55 + 1 + 944 + 301.54 + Cs + + 1.87 + + [Xe] 6s1 + 2.35 + 0.79 + 2.67 + + 67.74 + + + 70 + + + 2.092 + + 3.894 + + 0.24 + + + + 35.9 + + + + + Copper + Cobre2 + http://es.wikipedia.org/wiki/Cobre + 63.546 + 29 + 2, 1 + 2840 + 1356.6 + Cu + + 8.96 + + [Ar] 3d10 4s1 + 1.17 + 1.9 + 1.28 + + 300.5 + + + 7.1 + + + 13.14 + + 7.726 + + 0.385 + + + + 401 + + + + + Dubnium + Unnilpentium2 + http://es.wikipedia.org/wiki/Unnilpentium + 262 + 105 + Db + [Rn] 5f14 6d3 7s2 + + + + + + + Dysprosium + Disprosio2 + http://es.wikipedia.org/wiki/Disprosio + 162.5 + 66 + 3 + 2840 + 1685 + Dy + + 8.55 + + [Xe] 4f10 6s2 + 1.59 + 1.22 + 1.8 + + 230 + + + 19 + + 5.93 + + 0.173 + + + + 10.7 + + + + + Erbium + Erbio2 + http://es.wikipedia.org/wiki/Erbio + 167.26 + 68 + 3 + 3140 + 1802 + Er + + 9.07 + + [Xe] 4f12 6s2 + 1.57 + 1.24 + 1.78 + + 292.88 + + + 18.4 + + + 17.15 + + 6.101 + + 0.168 + + + + 14.3 + + + + + Einsteinium + Einstenio7 + http://es.wikipedia.org/wiki/Einstenio + 252 + 99 + 1130 + Es + [Rn] 5f11 7s2 + 1.3 + + 6.42 + + + 10 + + + + + Europium + Europio2 + http://es.wikipedia.org/wiki/Europio + 151.965 + 63 + 3, 2 + 1800 + 1095 + Eu + + 5.24 + + [Xe] 4f7 6s2 + 1.85 + 1.2 + 1.99 + + 175.73 + + + 28.9 + + + 9.21 + + 5.67 + + 0.182 + + + + 13.9 + + + + + Fluorine + Flúor5 + http://es.wikipedia.org/wiki/Fluor + 18.9984 + 9 + -1 + 85 + 53.55 + F + + 1.696 + + 1s2 2s2 p5 + 0.72 + 3.98 + 0.57 + + 3.2698 + + + 17.1 + + + 0.26 + + 17.422 + + 0.824 + + + + 0.0279 + + + + + Iron + Hierro2 + http://es.wikipedia.org/wiki/Hierro + 55.847 + 26 + 2, 3 + 3023 + 1808 + Fe + + 7.874 + + [Ar] 3d6 4s2 + 1.17 + 1.83 + 1.26 + + 349.5 + + + 7.1 + + + 13.8 + + 7.87 + + 0.449 + + + + 80.2 + + + + + Fermium + Fermio7 + http://es.wikipedia.org/wiki/Fermio + 257 + 100 + 1800 + Fm + [Rn] 5f12 7s2 + 1.3 + + 6.5 + + + 10 + + + + + Francium + Francio1 + http://es.wikipedia.org/wiki/Francio + 223 + 87 + 1 + 950 + 300 + Fr + [Rn] 7s1 + 0.7 + 2.7 + + 64 + + + 2.1 + + 0 + + + 15 + + + + + Gallium + Galio3 + http://es.wikipedia.org/wiki/Galio + 69.723 + 31 + 3 + 2478 + 302.92 + Ga + + 5.91 + + [Ar] 3d10 4s2 p1 + 1.26 + 1.81 + 1.41 + + 256.06 + + + 11.8 + + + 5.59 + + 5.999 + + 0.371 + + + + 40.6 + + + + + Gadolinium + Gadolinio2 + http://es.wikipedia.org/wiki/Gadolinio + 157.25 + 64 + 3 + 3545 + 1585 + Gd + + 7.9 + + [Xe] 4f7 5d1 6s2 + 1.61 + 1.2 + 1.8 + + 311.71 + + + 19.9 + + + 10.46 + + 6.15 + + 0.236 + + + + 10.6 + + + + + Germanium + Germanio3 + http://es.wikipedia.org/wiki/Germanio + 72.61 + 32 + 4 + 3107 + 1211.5 + Ge + + 5.32 + + [Ar] 3d10 4s2 p2 + 1.22 + 2.01 + 1.37 + + 334.3 + + + 13.6 + + + 31.8 + + 7.899 + + 0.32 + + + + 59.9 + + + + + Hydrogen + Hidrógeno0 + http://es.wikipedia.org/wiki/Hidrogeno + 1.00794 + 1 + 1 + 20.28 + 13.81 + H + + 0.0899 + + 1s1 + 0.32 + 2.1 + 2.08 + + 0.4581 + + + 14.1 + + + 0.0585 + + 13.598 + + 14.304 + + + + 0.1815 + + + + + Helium + Helio6 + http://es.wikipedia.org/wiki/Helio + 4.0026 + 2 + 4.216 + 0.95 + He + + 0.1785 + + 1s2 + 0.93 + 0 + + 0.084 + + + 31.8 + + + 0.021 + + 24.587 + + 5.193 + + + + 0.152 + + + + + Hafnium + Hafnio2 + http://es.wikipedia.org/wiki/Hafnio + 178.49 + 72 + 4 + 4875 + 2504 + Hf + + 13.31 + + [Xe] 4f14 5d2 6s2 + 1.44 + 1.3 + 1.67 + + 661.07 + + + 13.6 + + + 21.76 + + 6.65 + + 0.14 + + + + 23 + + + + + Mercury + Mercurio2 + http://es.wikipedia.org/wiki/Mercurio + 200.59 + 80 + 2, 1 + 629.88 + 234.31 + Hg + + 13.55 + + [Xe] 4f14 5d10 6s2 + 1.49 + 2 + 1.6 + + 59.3 + + + 14.8 + + + 2.292 + + 10.437 + + 0.140 + + + + 8.34 + + + + + Holmium + Holmio2 + http://es.wikipedia.org/wiki/Holmio + 164.9303 + 67 + 3 + 2968 + 1747 + Ho + + 8.8 + + [Xe] 4f11 6s2 + 1.58 + 1.23 + 1.79 + + 251.04 + + + 18.7 + + + 11.06 + + 6.02 + + 0.165 + + + + 16.2 + + + + + Hassium + Hassium2 + http://es.wikipedia.org/wiki/Hassium + 265 + 108 + Hs + [Rn] 5f14 6d6 7s2 + + + + + + + Iodine + Yodo5 + http://es.wikipedia.org/wiki/Yodo + 126.9045 + 53 + +/-1, 5, 7 + 457.5 + 386.7 + I + + 4.93 + + [Kr] 4d10 5s2 p5 + 1.33 + 2.66 + 1.32 + + 20.9 + + + 25.7 + + + 7.76 + + 10.451 + + 0.145 + + + + 0.449 + + + + + Indium + Indio3 + http://es.wikipedia.org/wiki/Indio + 114.82 + 49 + 3 + 2350 + 429.78 + In + + 7.31 + + [Kr] 4d10 5s2 p1 + 1.44 + 1.78 + 1.66 + + 226.35 + + + 15.7 + + + 3.26 + + 5.786 + + 0.233 + + + + 81.6 + + + + + Iridium + Iridio2 + http://es.wikipedia.org/wiki/Iridio + 192.22 + 77 + 2, 3, 4, 6 + 4700 + 2720 + Ir + + 22.6 + + [Xe] 4f14 5d7 6s2 + 1.27 + 2.2 + 1.36 + + 563.58 + + + 8.54 + + + 26.36 + + 9.1 + + 0.13 + + + + 147 + + + + + Potassium + Potasio1 + http://es.wikipedia.org/wiki/Potasio + 39.0983 + 19 + 1 + 1033 + 336.8 + K + + 0.86 + + [Ar] 4s1 + 2.03 + 0.82 + 2.35 + + 76.9 + + + 45.3 + + + 2.33 + + 4.341 + + 0.757 + + + + 102.5 + + + + + Krypton + Criptón6 + http://es.wikipedia.org/wiki/Cripton + 83.8 + 36 + 120.85 + 116 + Kr + + 3.75 + + [Ar] 3d10 4s2 p6 + 1.89 + 0 + 1.03 + + 9.029 + + + 32.2 + + + 1.638 + + 13.999 + + 0.248 + + + + 0.00949 + + + + + Lanthanum + Lantano2 + http://es.wikipedia.org/wiki/Lantano + 138.9055 + 57 + 3 + 3737 + 1191 + La + + 6.15 + + [Xe] 5d1 6s2 + 1.25 + 1.1 + 1.38 + + 399.57 + + + 22.5 + + + 11.3 + + 5.58 + + 0.19 + + + + 13.5 + + + + + Lithium + Litio1 + http://es.wikipedia.org/wiki/Litio + 6.941 + 3 + 1 + 1615 + 453.7 + Li + + 0.53 + + 1s2 2s1 + 1.23 + 0.98 + 1.55 + + 147.1 + + + 13.1 + + + 3 + + 5.392 + + 3.582 + + + + 84.7 + + + + + Lawrencium + Laurencio7 + http://es.wikipedia.org/wiki/Laurencio + 262 + 103 + 1900 + Lr + [Rn] 5f14 6d1 7s2 + + + + + 10 + + + + + Lutetium + Lutecio2 + http://es.wikipedia.org/wiki/Lutecio + 174.967 + 71 + 3 + 3668 + 1936 + Lu + + 9.84 + + [Xe] 4f14 5d1 6s2 + 1.56 + 1.27 + 1.75 + + 355 + + + 17.8 + + + 18.6 + + 5.43 + + 0.15 + + + + 16.4 + + + + + Mendelevium + Mendelevio7 + http://es.wikipedia.org/wiki/Mendelevio + 258 + 101 + 1100 + Md + [Rn] 5f13 7s2 + 1.3 + + 6.58 + + + 10 + + + + + Magnesium + Magnesio1 + http://es.wikipedia.org/wiki/Magnesio + 24.305 + 12 + 2 + 1380 + 922 + Mg + + 1.74 + + [Ne] 3s2 + 1.36 + 1.31 + 1.6 + + 127.6 + + + 14 + + + 8.95 + + 7.646 + + 1.02 + + + + 156 + + + + + Manganese + Manganeso2 + http://es.wikipedia.org/wiki/Manganeso + 54.938 + 25 + 7, 6, 4, 2, 3 + 2335 + 1518 + Mn + + 7.44 + + [Ar] 3d5 4s2 + 1.17 + 1.55 + 1.35 + + 219.74 + + + 7.39 + + + 14.64 + + 7.435 + + 0.48 + + + + 7.82 + + + + + Molybdenum + Molibdeno2 + http://es.wikipedia.org/wiki/Molibdeno + 95.94 + 42 + 6, 5, 4, 3, 2 + 4912 + 2896 + Mo + + 10.22 + + [Kr] 4d5 5s1 + 1.3 + 2.16 + 1.39 + + 590.4 + + + 9.4 + + + 36 + + 7.099 + + 0.25 + + + + 138 + + + + + Meitnerium + Meitherium2 + http://es.wikipedia.org/wiki/Meitherium + 266 + 109 + Mt + [Rn] 5f14 6d7 7s2 + + + + + + + Nitrogen + Nitrógeno5 + http://es.wikipedia.org/wiki/Nitrogeno + 14.0067 + 7 + +/-3, 5, 4, 2 + 77.344 + 63.15 + N + + 1.251 + + 1s2 2s2 p3 + 0.75 + 3.04 + 0.92 + + 2.7928 + + + 17.3 + + + 0.36 + + 14.534 + + 1.042 + + + + 0.02598 + + + + + Sodium + Sodio1 + http://es.wikipedia.org/wiki/Sodio + 22.98977 + 11 + 1 + 1156 + 371 + Na + + 0.97 + + [Ne] 3s1 + 1.54 + 0.93 + 1.9 + + 98.01 + + + 23.7 + + + 2.601 + + 5.139 + + 1.23 + + + + 141 + + + + + Niobium + Niobio2 + http://es.wikipedia.org/wiki/Niobio + 92.9064 + 41 + 5, 3 + 5015 + 2742 + Nb + + 8.57 + + [Kr] 4d4 5s1 + 1.34 + 1.6 + 1.46 + + 690.1 + + + 10.8 + + + 26.9 + + 6.88 + + 0.265 + + + + 53.7 + + + + + Neodymium + Neodimio2 + http://es.wikipedia.org/wiki/Neodimio + 144.24 + 60 + 3 + 3347 + 1294 + Nd + + 7.01 + + [Xe] 4f4 6s2 + 1.64 + 1.14 + 1.82 + + 283.68 + + + 20.6 + + + 10.88 + + 5.49 + + 0.19 + + + + 16.5 + + + + + Neon + Neón6 + http://es.wikipedia.org/wiki/Neon + 20.1797 + 10 + 27.1 + 24.55 + Ne + + 0.900 + + 1s2 2s2 p6 + 0.71 + 0 + 0.51 + + 1.77 + + + 16.9 + + + 0.34 + + 21.564 + + 1.03 + + + + 0.0493 + + + + + Nickel + Niquel2 + http://es.wikipedia.org/wiki/Niquel + 58.6934 + 28 + 2, 3 + 3005 + 1726 + Ni + + 8.9 + + [Ar] 3d8 4s2 + 1.15 + 1.91 + 1.24 + + 377.5 + + + 6.6 + + + 17.2 + + 7.635 + + 0.444 + + + + 90.7 + + + + + Nobelium + Nobelio7 + http://es.wikipedia.org/wiki/Nobelio + 259 + 102 + 1100 + No + [Rn] 5f14 7s2 + 1.3 + + 6.65 + + + 10 + + + + + Neptunium + Neptunio7 + http://es.wikipedia.org/wiki/Neptunio + 237.0482 + 93 + 6, 5, 4, 3 + 4175 + 912 + Np + + 20.2 + + [Rn] 5f4 6d1 7s2 + 1.36 + 1.3 + + 21.1 + + 6.19 + + + 6.3 + + + + + Oxygen + Oxígeno5 + http://es.wikipedia.org/wiki/Oxigeno + 15.9994 + 8 + -2 + 90.188 + 54.8 + O + + 1.429 + + 1s2 2s2 p4 + 0.73 + 3.44 + 0.65 + + 3.4109 + + + 14 + + + 0.222 + + 13.618 + + 0.92 + + + + 0.2674 + + + + + Osmium + Osmio2 + http://es.wikipedia.org/wiki/Osmio + 190.2 + 76 + 2, 3, 4, 6, 8 + 5300 + 3300 + Os + + 22.6 + + [Xe] 4f14 5d6 6s2 + 1.26 + 2.2 + 1.35 + + 627.6 + + + 8.43 + + + 29.29 + + 8.7 + + 0.13 + + + + 87.6 + + + + + Phosphorus + Fósforo5 + http://es.wikipedia.org/wiki/Fosforo + 30.97376 + 15 + +/-3, 5, 4 + 553 + 317.3 + P + + 1.82 + + [Ne] 3s2 p3 + 1.06 + 2.19 + 1.28 + + 12.4 + + + 17 + + + 0.63 + + 10.486 + + 0.769 + + + + 0.235 + + + + + Protactinium + Procatinio7 + http://es.wikipedia.org/wiki/Proactinio + 231.0359 + 91 + 5, 4 + 4300 + 1845 + Pa + + 15.4 + + [Rn] 5f2 6d1 7s2 + 1.5 + 1.61 + + 15 + + 5.88 + + + 47 + + + + + Lead + Plomo3 + http://es.wikipedia.org/wiki/Plomo + 207.2 + 82 + 4, 2 + 2023 + 600.65 + Pb + + 11.35 + + [Xe] 4f14 5d10 6s2 p2 + 1.47 + 2.33 + 1.75 + + 177.9 + + + 18.3 + + + 4.77 + + 7.416 + + 0.129 + + + + 35.3 + + + + + Palladium + Paladio2 + http://es.wikipedia.org/wiki/Paladio + 106.42 + 46 + 2, 4 + 3240 + 1825 + Pd + + 12 + + [Kr] 4d10 + 1.28 + 2.2 + 1.37 + + 393.3 + + + 8.9 + + + 16.74 + + 8.34 + + 0.244 + + + + 71.8 + + + + + Promethium + Promecio2 + http://es.wikipedia.org/wiki/Promecio + 145 + 61 + 3 + 3273 + 1315 + Pm + + 7.22 + + [Xe] 4f5 6s2 + 1.63 + 1.13 + + 22.4 + + 5.55 + + + 17.9 + + + + + Polonium + Polonio3 + http://es.wikipedia.org/wiki/Polonio + 209 + 84 + 4, 2 + 527 + Po + + 9.3 + + [Xe] 4f14 5d10 6s2 p4 + 1.53 + 2 + 1.67 + + 120 + + + 22.7 + + + 13 + + 8.42 + + + 20 + + + + + Praseodymium + Praseodimio2 + http://es.wikipedia.org/wiki/Prasedimio + 140.9077 + 59 + 3, 4 + 3785 + 1204 + Pr + + 6.77 + + [Xe] 4f3 6s2 + 1.65 + 1.13 + 1.82 + + 332.63 + + + 20.8 + + + 10.04 + + 5.42 + + 0.193 + + + + 12.5 + + + + + Platinum + Platino2 + http://es.wikipedia.org/wiki/Platino + 195.08 + 78 + 2, 4 + 4100 + 2042.1 + Pt + + 21.45 + + [Xe] 4f14 5d9 6s1 + 1.3 + 2.28 + 1.39 + + 510.45 + + + 9.1 + + + 19.66 + + 9 + + 0.13 + + + + 71.6 + + + + + Plutonium + Plutonio7 + http://es.wikipedia.org/wiki/Plutonio + 244 + 94 + 6, 5, 4, 3 + 3505 + 913 + Pu + + 19.84 + + [Rn] 5f6 7s2 + 1.28 + 1.51 + + 12.32 + + 6.06 + + 0.13 + + + + 6.74 + + + + + Radium + Radio1 + http://es.wikipedia.org/wiki/Radio + 226.0254 + 88 + 2 + 1413 + 973 + Ra + + 5 + + [Rn] 7s2 + 0.89 + 2.33 + + 136.82 + + + 45.2 + + + 8.37 + + 5.279 + + 0.094 + + + + 18.6 + + + + + Rubidium + Rubidio1 + http://es.wikipedia.org/wiki/Rubidio + 85.4678 + 37 + 1 + 961 + 312.63 + Rb + + 1.532 + + [Kr] 5s1 + 2.16 + 0.82 + 2.48 + + 69.2 + + + 55.9 + + + 2.34 + + 4.177 + + 0.363 + + + + 58.2 + + + + + Rhenium + Renio2 + http://es.wikipedia.org/wiki/Renio + 186.207 + 75 + 7, 6, 4, 2, -1 + 5870 + 3455 + Re + + 21 + + [Xe] 4f14 5d5 6s2 + 1.28 + 1.9 + 1.37 + + 707.1 + + + 8.85 + + + 33.05 + + 7.88 + + 0.137 + + + + 47.9 + + + + + Rutherfordium + Rutherfordium2 + http://es.wikipedia.org/wiki/Rutherfordium + 261 + 104 + Rf + [Rn] 5f14 6d2 7s2 + + + + + + + Rhodium + Rodio2 + http://es.wikipedia.org/wiki/Rodio + 102.9055 + 45 + 2, 3, 4 + 3970 + 2236 + Rh + + 12.41 + + [Kr] 4d8 5s1 + 1.25 + 2.28 + 1.34 + + 495.39 + + + 8.3 + + + 21.76 + + 7.46 + + 0.242 + + + + 150 + + + + + Radon + Radón6 + http://es.wikipedia.org/wiki/Radon + 222 + 86 + 211.4 + 202 + Rn + + 9.73 + + [Xe] 4f14 5d10 6s2 p6 + 0 + 1.34 + + 16.4 + + + 50.5 + + + 2.9 + + 10.748 + + 0.094 + + + + 0.00364 + + + + + Ruthenium + Rutenio2 + http://es.wikipedia.org/wiki/Rutenio + 101.07 + 44 + 2, 3, 4, 6, 8 + 4425 + 2610 + Ru + + 12.37 + + [Kr] 4d7 5s1 + 1.25 + 2.2 + 1.34 + + 567.77 + + + 8.3 + + + 25.52 + + 7.37 + + 0.238 + + + + 117 + + + + + Sulfur + Azufre5 + http://es.wikipedia.org/wiki/Azufre + 32.066 + 16 + +/-2, 4, 6 + 717.82 + 392.2 + S + + 2.07 + + [Ne] 3s2 p4 + 1.02 + 2.58 + 1.27 + + 10 + + + 15.5 + + + 1.73 + + 10.36 + + 0.71 + + + + 0.269 + + + + + Silver + Plata2 + http://es.wikipedia.org/wiki/Plata + 107.868 + 47 + 1 + 2436 + 1235.08 + Ag + + 10.5 + + [Kr] 4d10 5s1 + 1.34 + 1.93 + 1.44 + + 250.63 + + + 10.3 + + + 11.3 + + 7.576 + + 0.232 + + + + 429 + + + + + Scandium + Escandio2 + http://es.wikipedia.org/wiki/Escandio + 44.9559 + 21 + 3 + 3109 + 1814 + Sc + + 2.99 + + [Ar] 3d1 4s2 + 1.44 + 1.36 + 1.62 + + 304.8 + + + 15 + + + 16.11 + + 6.54 + + 0.568 + + + + 15.8 + + + + + Selenium + Selenio5 + http://es.wikipedia.org/wiki/Selenio + 78.96 + 34 + -2, 4, 6 + 958 + 494 + Se + + 4.79 + + [Ar] 3d10 4s2 p4 + 1.16 + 2.55 + 1.4 + + 26.32 + + + 16.5 + + + 5.54 + + 9.752 + + 0.32 + + + + 2.04 + + + + + Seaborgium + Seaborgium2 + http://es.wikipedia.org/wiki/Seaborgium + 263 + 106 + Sg + [Rn] 5f14 6d4 7s2 + + + + + + + Silicon + Silicio4 + http://es.wikipedia.org/wiki/Silicio + 28.0855 + 14 + 4 + 2630 + 1683 + Si + + 2.33 + + [Ne] 3s2 p2 + 1.11 + 1.9 + 1.32 + + 359 + + + 12.1 + + + 50.2 + + 8.151 + + 0.70 + + + + 148 + + + + + Samarium + Samario2 + http://es.wikipedia.org/wiki/Samario + 150.36 + 62 + 3, 2 + 2067 + 1347 + Sm + + 7.52 + + [Xe] 4f6 6s2 + 1.62 + 1.17 + 1.81 + + 191.63 + + + 19.9 + + + 11.09 + + 5.63 + + 0.197 + + + + 13.3 + + + + + Strontium + Estroncio1 + http://es.wikipedia.org/wiki/Estroncio + 87.62 + 38 + 2 + 1655 + 1042 + Sr + + 2.54 + + [Kr] 5s2 + 1.91 + 0.95 + 2.15 + + 136.9 + + + 33.7 + + + 8.2 + + 5.695 + + 0.3 + + + + 35.3 + + + + + Tantalum + Tántalio2 + http://es.wikipedia.org/wiki/Tantalio + 180.9479 + 73 + 5 + 5730 + 3293 + Ta + + 16.65 + + [Xe] 4f14 5d3 6s2 + 1.34 + 1.5 + 1.49 + + 737 + + + 10.9 + + + 36 + + 7.89 + + 0.14 + + + + 57.5 + + + + + Terbium + Terbio2 + http://es.wikipedia.org/wiki/Terbio + 158.9253 + 65 + 3, 4 + 3500 + 1629 + Tb + + 8.23 + + [Xe] 4f9 6s2 + 1.59 + 1.1 + 1.8 + + 19.2 + + + 15.48 + + 5.86 + + 0.18 + + + + 11.1 + + + + + Technetium + Tecnecio2 + http://es.wikipedia.org/wiki/Tecnecio + 98 + 43 + 7 + 4538 + 2477 + Tc + + 11.5 + + [Kr] 4d5 5s2 + 1.27 + 1.9 + 1.36 + + 502 + + + 8.5 + + + 23 + + 7.28 + + 0.24 + + + + 50.6 + + + + + Tellurium + Teluro4 + http://es.wikipedia.org/wiki/Teluro + 127.6 + 52 + -2, 4, 6 + 1261 + 722.72 + Te + + 6.24 + + [Kr] 4d10 5s2 p4 + 1.36 + 2.1 + 1.42 + + 50.63 + + + 20.5 + + + 17.49 + + 9.009 + + 0.202 + + + + 2.35 + + + + + Thorium + Torio7 + http://es.wikipedia.org/wiki/Torio + 232.0381 + 90 + 4 + 5060 + 2028 + Th + + 11.72 + + [Rn] 6d2 7s2 + 1.65 + 1.3 + 1.8 + + 543.92 + + + 19.9 + + + 15.65 + + 6.08 + + 0.113 + + + + 54 + + + + + Tin + Estaño3 + http://es.wikipedia.org/wiki/Estaño + 118.71 + 50 + 4, 2 + 2876 + 505.12 + Sn + + 7.31 + + [Kr] 4d10 5s2 p2 + 1.41 + 1.96 + 1.62 + + 290.37 + + + 16.3 + + + 7.2 + + 7.344 + + 0.228 + + + + 66.6 + + + + + Titanium + Titanio2 + http://es.wikipedia.org/wiki/Titanio + 47.88 + 22 + 4, 3 + 3560 + 1945 + Ti + + 4.54 + + [Ar] 3d2 4s2 + 1.32 + 1.54 + 1.45 + + 425.2 + + + 10.6 + + + 18.6 + + 6.82 + + 0.523 + + + + 21.9 + + + + + Thallium + Talio3 + http://es.wikipedia.org/wiki/Talio + 204.383 + 81 + 3, 1 + 1746 + 577 + Tl + + 11.85 + + [Xe] 4f14 5d10 6s2 p1 + 1.48 + 2.04 + 1.71 + + 162.09 + + + 17.2 + + + 4.27 + + 6.108 + + 0.129 + + + + 46.1 + + + + + Thulium + Tulio2 + http://es.wikipedia.org/wiki/Tulio + 168.9342 + 69 + 3, 2 + 2223 + 1818 + Tm + + 9.32 + + [Xe] 4f13 6s2 + 1.56 + 1.25 + 1.77 + + 191 + + + 18.1 + + + 16.8 + + 6.184 + + 0.16 + + + + 16.8 + + + + + Uranium + Uranio7 + http://es.wikipedia.org/wiki/Uranio + 238.029 + 92 + 6, 5, 4, 3 + 4407 + 1408 + U + + 18.95 + + [Rn] 5f3 6d1 7s2 + 1.42 + 1.38 + 1.38 + + 422.58 + + + 12.5 + + + 15.48 + + 6.05 + + 0.12 + + + + 27.6 + + + + + ununbium + Unumbium2 + http://es.wikipedia.org/wiki/Unumbium + 277 + 112 + Uub + [Rn] 5f14 6d10 7s2 + + + + + + + ununnilium + Ununnilium2 + http://es.wikipedia.org/wiki/Ununnilium + 269 + 110 + Uun + [Rn] 5f14 6d8 7s2 + + + + + + + unununium + Unnununium2 + http://es.wikipedia.org/wiki/Unnununium + 272 + 111 + Uuu + [Rn] 5f14 6d9 7s2 + + + + + + + Vanadium + Vanadio2 + http://es.wikipedia.org/wiki/Vanadio + 50.9415 + 23 + 5, 4, 3, 2 + 3650 + 2163 + V + + 6.11 + + [Ar] 3d3 4s2 + 1.22 + 1.63 + 1.34 + + 446.7 + + + 8.35 + + + 20.8 + + 6.74 + + 0.489 + + + + 30.7 + + + + + Tungsten + Tungsteno2 + http://es.wikipedia.org/wiki/Tungsteno + 183.85 + 74 + 6, 5, 4, 3, 2 + 5825 + 3695 + W + + 19.3 + + [Xe] 4f14 5d4 6s2 + 1.3 + 2.36 + 1.41 + + 422.58 + + + 9.53 + + + 35.4 + + 7.98 + + 0.13 + + + + 174 + + + + + Xenon + Xenón6 + http://es.wikipedia.org/wiki/Xenon + 131.29 + 54 + 165.1 + 161.39 + Xe + + 5.9 + + [Kr] 4d10 5s2 p6 + 1.31 + 2.6 + 1.24 + + 12.64 + + + 42.9 + + + 2.3 + + 12.13 + + 0.158 + + + + 0.00569 + + + + + Yttrium + Itrio2 + http://es.wikipedia.org/wiki/Itrio + 88.9059 + 39 + 3 + 3611 + 1795 + Y + + 4.47 + + [Kr] 4d1 5s2 + 1.62 + 1.22 + 1.78 + + 363.3 + + + 19.8 + + + 17.5 + + 6.38 + + 0.3 + + + + 17.2 + + + + + Ytterbium + Iterbio2 + http://es.wikipedia.org/wiki/Iterbio + 173.04 + 70 + 3, 2 + 1469 + 1092 + Yb + + 6.97 + + [Xe] 4f14 6s2 + 1.7 + 1.1 + 1.94 + + 128 + + + 24.8 + + + 7.7 + + 6.254 + + 0.155 + + + + 34.9 + + + + + Zinc + Cinc2 + http://es.wikipedia.org/wiki/Cinc + 65.39 + 30 + 2 + 1180 + 692.73 + Zn + + 7.13 + + [Ar] 3d10 4s2 + 1.25 + 1.65 + 1.38 + + 115.3 + + + 9.2 + + + 7.38 + + 9.394 + + 0.388 + + + + 116 + + + + + Zirconium + Circonio2 + http://es.wikipedia.org/wiki/Circonio + 91.224 + 40 + 4 + 4682 + 2128 + Zr + + 6.51 + + [Kr] 4d2 5s2 + 1.45 + 1.33 + 1.6 + + 590.5 + + + 14.1 + + + 21 + + 6.84 + + 0.278 + + + + 22.7 + + + + diff --git a/web/datos.js b/web/datos.js new file mode 100644 index 0000000..4af3d93 --- /dev/null +++ b/web/datos.js @@ -0,0 +1 @@ +textos = new Array(new Array('Cromo','metal brillante'),new Array('Hidrogeno','hidrogeno'),new Array('Boro','Como borocoto'),new Array('Aluminio','Element metalico liviano muy comun')); \ No newline at end of file diff --git a/web/jquery.js b/web/jquery.js new file mode 100644 index 0000000..2e43a82 --- /dev/null +++ b/web/jquery.js @@ -0,0 +1,3408 @@ +(function(){ +/* + * jQuery 1.2.3 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $ + * $Rev: 4663 $ + */ + +// Map over jQuery in case of overwrite +if ( window.jQuery ) + var _jQuery = window.jQuery; + +var jQuery = window.jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.prototype.init( selector, context ); +}; + +// Map over the $ in case of overwrite +if ( window.$ ) + var _$ = window.$; + +// Map the jQuery namespace to the '$' one +window.$ = jQuery; + +// A simple way to check for HTML strings or ID strings +// (both of which we optimize for) +var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; + +// Is it a simple selector +var isSimple = /^.[^:#\[\.]*$/; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + return this; + + // Handle HTML strings + } else if ( typeof selector == "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Make sure an element was located + if ( elem ) + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + else { + this[0] = elem; + this.length = 1; + return this; + } + + else + selector = []; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return new jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + + return this.setArray( + // HANDLE: $(array) + selector.constructor == Array && selector || + + // HANDLE: $(arraylike) + // Watch for when an array-like object, contains DOM nodes, is passed in as the selector + (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || + + // HANDLE: $(*) + [ selector ] ); + }, + + // The current version of jQuery being used + jquery: "1.2.3", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // The number of elements contained in the matched element set + length: 0, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == undefined ? + + // Return a 'clean' array + jQuery.makeArray( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + var ret = -1; + + // Locate the position of the desired element + this.each(function(i){ + if ( this == elem ) + ret = i; + }); + + return ret; + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( name.constructor == String ) + if ( value == undefined ) + return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined; + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text != "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) + // The elements to wrap the target around + jQuery( html, this[0].ownerDocument ) + .clone() + .insertBefore( this[0] ) + .map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }) + .append(this); + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, false, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, true, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + find: function( selector ) { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); + + return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? + jQuery.unique( elems ) : + elems ); + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var clone = this.cloneNode(true), + container = document.createElement("div"); + container.appendChild(clone); + return jQuery.clean([container.innerHTML])[0]; + } else + return this.cloneNode(true); + }); + + // Need to set the expando to null on the cloned set if it exists + // removeData doesn't work here, IE removes it from the original as well + // this is primarily for IE but the data expando shouldn't be copied over in any browser + var clone = ret.find("*").andSelf().each(function(){ + if ( this[ expando ] != undefined ) + this[ expando ] = null; + }); + + // Copy the events from the original to the clone + if ( events === true ) + this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; + var events = jQuery.data( this, "events" ); + + for ( var type in events ) + for ( var handler in events[ type ] ) + jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); + }); + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, this ) ); + }, + + not: function( selector ) { + if ( selector.constructor == String ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return !selector ? this : this.pushStack( jQuery.merge( + this.get(), + selector.constructor == String ? + jQuery( selector ).get() : + selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? + selector : [selector] ) ); + }, + + is: function( selector ) { + return selector ? + jQuery.multiFilter( selector, this ).length > 0 : + false; + }, + + hasClass: function( selector ) { + return this.is( "." + selector ); + }, + + val: function( value ) { + if ( value == undefined ) { + + if ( this.length ) { + var elem = this[0]; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + + // Everything else, we just grab the value + } else + return (this[0].value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = value.constructor == Array ? + value : + [ value ]; + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value == undefined ? + (this.length ? + this[0].innerHTML : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + data: function( key, value ){ + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value == null ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data == undefined && this.length ) + data = jQuery.data( this[0], key ); + + return data == null && parts[1] ? + this.data( parts[0] ) : + data; + } else + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ + jQuery.data( this, key, value ); + }); + }, + + removeData: function( key ){ + return this.each(function(){ + jQuery.removeData( this, key ); + }); + }, + + domManip: function( args, table, reverse, callback ) { + var clone = this.length > 1, elems; + + return this.each(function(){ + if ( !elems ) { + elems = jQuery.clean( args, this.ownerDocument ); + + if ( reverse ) + elems.reverse(); + } + + var obj = this; + + if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) + obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); + + var scripts = jQuery( [] ); + + jQuery.each(elems, function(){ + var elem = clone ? + jQuery( this ).clone( true )[0] : + this; + + // execute all scripts after the elements have been injected + if ( jQuery.nodeName( elem, "script" ) ) { + scripts = scripts.add( elem ); + } else { + // Remove any inner scripts for later evaluation + if ( elem.nodeType == 1 ) + scripts = scripts.add( jQuery( "script", elem ).remove() ); + + // Inject the elements into the document + callback.call( obj, elem ); + } + }); + + scripts.each( evalScript ); + }); + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.prototype.init.prototype = jQuery.prototype; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( target.constructor == Boolean ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target != "object" && typeof target != "function" ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == 1 ) { + target = this; + i = 0; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + // Prevent never-ending loop + if ( target === options[ name ] ) + continue; + + // Recurse if we're merging object values + if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType ) + target[ name ] = jQuery.extend( target[ name ], options[ name ] ); + + // Don't bring in undefined values + else if ( options[ name ] != undefined ) + target[ name ] = options[ name ]; + + } + + // Return the modified object + return target; +}; + +var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {}; + +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning this function. + isFunction: function( fn ) { + return !!fn && typeof fn != "string" && !fn.nodeName && + fn.constructor != Array && /function/i.test( fn + "" ); + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + data = jQuery.trim( data ); + + if ( data ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.browser.msie ) + script.text = data; + else + script.appendChild( document.createTextNode( data ) ); + + head.appendChild( script ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + cache: {}, + + data: function( elem, name, data ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // Compute a unique ID for the element + if ( !id ) + id = elem[ expando ] = ++uuid; + + // Only generate the data cache if we're + // trying to access or manipulate it + if ( name && !jQuery.cache[ id ] ) + jQuery.cache[ id ] = {}; + + // Prevent overriding the named cache with undefined values + if ( data != undefined ) + jQuery.cache[ id ][ name ] = data; + + // Return the named cache data, or the ID for the element + return name ? + jQuery.cache[ id ][ name ] : + id; + }, + + removeData: function( elem, name ) { + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( jQuery.cache[ id ] ) { + // Remove the section of cache data + delete jQuery.cache[ id ][ name ]; + + // If we've removed all the data, remove the element's cache + name = ""; + + for ( name in jQuery.cache[ id ] ) + break; + + if ( !name ) + jQuery.removeData( elem ); + } + + // Otherwise, we want to remove all of the element's data + } else { + // Clean up the element expando + try { + delete elem[ expando ]; + } catch(e){ + // IE has trouble directly removing the expando + // but it's ok with using removeAttribute + if ( elem.removeAttribute ) + elem.removeAttribute( expando ); + } + + // Completely remove the data cache + delete jQuery.cache[ id ]; + } + }, + + // args is for internal usage only + each: function( object, callback, args ) { + if ( args ) { + if ( object.length == undefined ) { + for ( var name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( var i = 0, length = object.length; i < length; i++ ) + if ( callback.apply( object[ i ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( object.length == undefined ) { + for ( var name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var i = 0, length = object.length, value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames != undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use is(".class") + has: function( elem, className ) { + return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + var padding = 0, border = 0; + jQuery.each( which, function() { + padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + val -= Math.round(padding + border); + } + + if ( jQuery(elem).is(":visible") ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, val); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret; + + // A helper method for determining if an element's values are broken + function color( elem ) { + if ( !jQuery.browser.safari ) + return false; + + var ret = document.defaultView.getComputedStyle( elem, null ); + return !ret || ret.getPropertyValue("color") == ""; + } + + // We need to handle opacity special in IE + if ( name == "opacity" && jQuery.browser.msie ) { + ret = jQuery.attr( elem.style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + // Opera sometimes will give the wrong display answer, this fixes it, see #2037 + if ( jQuery.browser.opera && name == "display" ) { + var save = elem.style.outline; + elem.style.outline = "0 solid black"; + elem.style.outline = save; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && elem.style && elem.style[ name ] ) + ret = elem.style[ name ]; + + else if ( document.defaultView && document.defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + + var getComputedStyle = document.defaultView.getComputedStyle( elem, null ); + + if ( getComputedStyle && !color( elem ) ) + ret = getComputedStyle.getPropertyValue( name ); + + // If the element isn't reporting its values properly in Safari + // then some display: none elements are involved + else { + var swap = [], stack = []; + + // Locate all of the parent display: none elements + for ( var a = elem; a && color(a); a = a.parentNode ) + stack.unshift(a); + + // Go through and make them visible, but in reverse + // (It would be better if we knew the exact display type that they had) + for ( var i = 0; i < stack.length; i++ ) + if ( color( stack[ i ] ) ) { + swap[ i ] = stack[ i ].style.display; + stack[ i ].style.display = "block"; + } + + // Since we flip the display style, we have to handle that + // one special, otherwise get the value + ret = name == "display" && swap[ stack.length - 1 ] != null ? + "none" : + ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || ""; + + // Finally, revert the display styles back + for ( var i = 0; i < swap.length; i++ ) + if ( swap[ i ] != null ) + stack[ i ].style.display = swap[ i ]; + } + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var style = elem.style.left, runtimeStyle = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + elem.style.left = ret || 0; + ret = elem.style.pixelLeft + "px"; + + // Revert the changed values + elem.style.left = style; + elem.runtimeStyle.left = runtimeStyle; + } + } + + return ret; + }, + + clean: function( elems, context ) { + var ret = []; + context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' + if (typeof context.createElement == 'undefined') + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + jQuery.each(elems, function(i, elem){ + if ( !elem ) + return; + + if ( elem.constructor == Number ) + elem = elem.toString(); + + // Convert html string into DOM nodes + if ( typeof elem == "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and + + + + + + + + + + + + +
+ + + + + + +
+ +

Tabla de los elementos

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Serie Lantanidos

+ + + + + + + +
+ +

Serie Actinidos

+ + + + + + + +
+ + Mis Notas + + + + + + + + + + + + + #cccccc + + + #ccccff + + + #99ff99 + + + #ffff99 + + + #ffcc99 + + + #ff9966 + + + #cc99ff + + + #007000 + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + diff --git a/web/utiles.js b/web/utiles.js new file mode 100644 index 0000000..7d88de3 --- /dev/null +++ b/web/utiles.js @@ -0,0 +1,130 @@ + + function popup(popup_url,name,popup_width,popup_height) { + var tmp = window.open(popup_url,name,'resizable=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes,directories=no,width='+popup_width+',height='+popup_height); + } + + function mostrar(symbol,nombre,name,peso,numero,wiki) { + if (!mostrado) { + mostrado = true; + document.elementData.elementName.value = nombre; + document.elementData.editedText.value = readTextElement(nombre); + $("#textPopup").html("

"+ + "Elemento: "+nombre+" "+ + "(en inglés: "+name+")
"+ + "Símbolo: "+symbol+" "+ + "Peso atómico: "+peso+" "+ + "Número atómico: "+numero+"
"+ + "Wikipedia"+ + "

" ); + $("#pop").fadeIn('slow'); + } + } + + function popupText(text) { + $("#textPopup").html(text); + $("#pop").fadeIn('slow'); + mostrado = true; + } + + function openWiki(url) { + document.getElementById("wikiBody").src = url; + $("#wiki").fadeIn('slow'); + } + + function cerrarWiki() { + $("#wiki").fadeOut('slow'); + } + + function cerrarMisNotas() { + $("#misNotas").fadeOut('slow'); + } + + function verMisNotas() { + misNotasText = ""; + for (i = 0;i < textos.length; i++) { + textoElemento = textos[i]; + misNotasText = misNotasText + ""+textoElemento[0]+"
"+textoElemento[1]+"

"; + } + $("#textMisNotas").html(misNotasText); + $("#misNotas").fadeIn('slow'); + } + + + + function cerrar() { + $("#pop").fadeOut('slow'); + mostrado = false; + if (document.elementData.editedText.value != '') { + writeTextElement(document.elementData.elementName.value,document.elementData.editedText.value); + } + } + + function readTextElement(element) { + for(var i=0; i + * XO.register('read', function(content) { + * // Your code to consume the supplied content + * }) + * XO.register('write', function() { + * // Your code to return the content to save + * return 'monkey' + * }) + * + * + * Some commands for debugging are put in an element with the + * id 'xo-status' if it exists. + * + * + * Copiado de SocialCalc + * + * + */ + +var XO = window.XO = { + callbacks: { }, + set_status: function (msg) { + jQuery('#xo-status').html(msg) + }, + observer: { + observe: function(req_obj,topic,command) { + now = new Date().getTime() + XO.set_status("(" + now + ") Handling " + command) + try { + // We need access to use the XPCom functions below + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect") + + // Unwrap the XPCom objects to get at the data passed to us + req_obj = req_obj.QueryInterface(Components.interfaces.nsIMutableArray) + var command_arg = undefined + if (req_obj.length) { + var iter = req_obj.enumerate() + xp_arg = iter.getNext() + xp_arg = xp_arg.QueryInterface(Components.interfaces.nsISupportsString) + command_arg = xp_arg.toString() + } + + // Execute the registered callback method + return_value = XO.callbacks[command](command_arg) || '' + + // Wrap the return value back into the XPCom object + var result = Components.classes["@mozilla.org/supports-string;1"].createInstance( + Components.interfaces.nsISupportsString) + result.data = return_value + req_obj.clear() + req_obj.appendElement(result, false) + XO.set_status("(" + now + ") Handled " + command + ": (" + return_value + ")") + } + catch (err) { + XO.set_status("Error handling event: " + err) + } + } + }, + register: function(command, callback) { + XO.callbacks[command] = callback + } +} + +/* + * This snippet registers the XO observer to receive commands + * from the python XPCom code + */ +try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + var observerService = Components.classes["@mozilla.org/observer-service;1"] + .getService(Components.interfaces.nsIObserverService); + observerService.addObserver(XO.observer, 'xo-message', false); +} +catch(err) { + // Wait a bit to show this error, so the page has time to load up. + setTimeout( function() { + jQuery('#xo-status', 'JS Error: ' + err); + }, 1000) +} -- cgit v0.9.1