![]() |
Sergey Kornilov admin 1/6/2016 |
Check HTML <sup> tag: |
B
|
bioman author 1/6/2016 |
Thanks for the reply Sergey, but how would my users (who do not know anything about html) be able to put in a superscript or subscript? For example, if one of my users is a biology teacher and wants to type in CO2 (with a subscripted 2). Check HTML <sup> tag: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup |
![]() |
Sergey Kornilov admin 1/7/2016 |
Well, you will have to teach you teachers then, provide some sort of cheat code on what kind of HTML tags they can use there. Probably you can find some sort of HTML Editor that comes with subscript/supercript buttons that make this task easier. |
![]() |
HJB 1/7/2016 |
Citing ex http://stackoverflow.com/questions/17683654/superscript-in-input-field-of-text-type |
B
|
bioman author 1/7/2016 |
Thanks walk2fly, Citing ex http://stackoverflow.com/questions/17683654/superscript-in-input-field-of-text-type How about a plugin: $.fn.superScript = function() { var chars = '+−=()0123456789AaÆᴂɐɑɒBbcɕDdðEeƎəɛɜɜfGgɡɣhHɦIiɪɨᵻɩjJʝɟKklLʟᶅɭMmɱNnɴɲɳŋOoɔᴖᴗɵȢPpɸrRɹɻʁsʂʃTtƫUuᴜᴝʉɥɯɰʊvVʋʌwWxyzʐʑʒꝯᴥβγδθφχнნʕⵡ', sup = '⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸⁹ᴬᵃᴭᵆᵄᵅᶛᴮᵇᶜᶝᴰᵈᶞᴱᵉᴲᵊᵋᶟᵌᶠᴳᵍᶢˠʰᴴʱᴵⁱᶦᶤᶧᶥʲᴶᶨᶡᴷᵏˡᴸᶫᶪᶩᴹᵐᶬᴺⁿᶰᶮᶯᵑᴼᵒᵓᵔᵕᶱᴽᴾᵖᶲʳᴿʴʵʶˢᶳᶴᵀᵗᶵᵁᵘᶸᵙᶶᶣᵚᶭᶷᵛⱽᶹᶺʷᵂˣʸᶻᶼᶽᶾꝰᵜᵝᵞᵟᶿᵠᵡᵸჼˤⵯ'; return this.each(function() { this.value = this.value.replace(/<sup[^>]>(.?)<\/sup>/g, function(x) { var str = '', txt = $.trim($(x).unwrap().text()); for (var i=0; i<txt.length; i++) { var n = chars.indexOf(txt[i]); str += (n!=-1 ? sup[n] : txt[i]); } return str; }); }); } called like: $('input').superScript(); unquote Alternatively one of the EDITORS as seen under https://xlinesoft.com/phprunner/docs/rich_text_editor_plugins.htm cam join in. |
![]() |
HJB 1/7/2016 |
You as well as your customers can test the "CO²" and else issues under: |
B
|
bioman author 1/7/2016 |
Hi Walk2fly,
|
![]() |
HJB 1/8/2016 |
To 1) I cannot properly answer on that as it depends on how and whether the editor's programming code is supporting such issue or not. What I see in other EDITOR products like e.g. https://www.tinymce.com is that Subscript and Superscript icons can be added by some code injections into the upper menu, read e.g. http://wptavern.com/how-to-add-subscript-and-superscript-characters-in-wordpress (a recent publication informed that WORDPRESS had now been conquering more than 25% of worldwide page content, so, at least me is 100% sure that the PHPR developer team cannot afford to not at least look for a solution or comfortable workaround as the WORDPRESS worldwide market share of roughly 25% represents a quarter of mankind using the Internet for publications of all kind or say, on PHPRunner marketing, it is worth to invest some brainstorming). |