diff --git a/README.md b/README.md index dfcdb90..3c3c27a 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Materials Informatics HTML5 Player +HTML5 Player for Materials Informatics ====== In-browser ultra-fast and lightweight renderer of the [crystallographic information files (CIF)](https://en.wikipedia.org/wiki/Crystallographic_Information_File) and VASP POSCAR structures, written in a pure JavaScript. @@ -9,4 +9,4 @@ Development layout is inside ```src``` folder. The modular approach based on [re Additionally, CIF and POSCAR files from anywhere on the web can be displayed. A file URL must be then passed via **_document.location.hash_** property (browser's address bar, after sharp symbol). However if the file is served from another domain, PHP or Python proxy for remote requests should be used. There are examples of PHP and Python proxies (not for production use) in ```src``` folder. Obviously, it is safer to serve CIF files from the same domain. -_Let's cooperate on the further development! Your contribution will be very much appreciated._ +_Let's cooperate on the further development!_ diff --git a/src/js/libs/matinfio.js b/src/js/libs/matinfio.js index 44a031d..712816b 100755 --- a/src/js/libs/matinfio.js +++ b/src/js/libs/matinfio.js @@ -53,7 +53,7 @@ var custom_CIF_loop_props = {'_atom_site_occupancy': 'site occupancies', '_atom_ function detect_format(str){ if (str.indexOf("_cell_angle_gamma ") > 0 && str.indexOf("loop_") > 0) return 'CIF'; - var lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n"); + var lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n"); if (lines.length > 6){ if (lines[6].toLowerCase().substr(0, 6) == 'direct') return 'POSCAR'; } @@ -179,7 +179,7 @@ function jsobj2flatten(crystal){ } function cif2jsobj(str){ - var structures = [], symops = [], atprop_seq = [], lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n"), cur_structure = {'cell': {}, 'atoms': []}; + var structures = [], symops = [], atprop_seq = [], lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n"), cur_structure = {'cell': {}, 'atoms': []}; var loop_active = false, new_structure = false, symops_active = false; var cur_line = "", line_data = [], symmetry_seq = []; var cell_props = ['a', 'b', 'c', 'alpha', 'beta', 'gamma']; @@ -283,7 +283,7 @@ function cif2jsobj(str){ } function poscar2jsobj(str){ - var lines = str.toString().replace(/(\r\n|\n|\r)/gm, "\n").split("\n"), cell = [], atoms = [], factor = 1.0, atindices = [], types = []; + var lines = str.toString().replace(/(\r\n|\r)/gm, "\n").split("\n"), cell = [], atoms = [], factor = 1.0, atindices = [], types = []; var atom_props = ['x', 'y', 'z', 'symbol']; var i, j, len = lines.length, line_data = [], atidx = 0; for (i = 1; i < len; i++){