diff --git a/web/script_2.js b/web/script_2.js index 56316ea..8f0d6ee 100644 --- a/web/script_2.js +++ b/web/script_2.js @@ -1,3 +1,33 @@ +const TOC_MOBILE = + 'ToC = {\n' + + ' \'1. Collections\': [List, Dictionary, Set,\n' + + ' Tuple, Range, Enumerate,\n' + + ' Iterator, Generator],\n' + + ' \'2. Types\': [Type, String, Regular_Exp,\n' + + ' Format, Numbers,\n' + + ' Combinatorics, Datetime],\n' + + ' \'3. Syntax\': [Args, Inline, Closure,\n' + + ' Decorator, Class,\n' + + ' Duck_Types, Enum,\n' + + ' Exceptions],\n' + + ' \'4. System\': [Print, Input,\n' + + ' Command_Line_Arguments,\n' + + ' Open, Path,\n' + + ' Command_Execution],\n' + + ' \'5. Data\': [JSON, Pickle, CSV, SQLite,\n' + + ' Bytes, Struct, Array,\n' + + ' MemoryView, Deque],\n' + + ' \'6. Advanced\': [Threading, Operator,\n' + + ' Introspection,\n' + + ' Metaprograming, Eval,\n' + + ' Coroutine],\n' + + ' \'7. Libraries\': [Progress_Bar, Plot, Table,\n' + + ' Curses, Logging, Scraping,\n' + + ' Web, Profile, NumPy,\n' + + ' Image, Animation, Audio,\n' + + ' Synthesizer]\n' + + '}\n'; + const DIAGRAM_1_A = '+-------------+-------------+\n' + '| Classes | Metaclasses |\n' + @@ -232,6 +262,10 @@ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine isMobile = true; } +if (isMobile) { + $(`code:contains(ToC)`).html(TOC_MOBILE); +} + // ===== Scroll to Top ==== $(window).scroll(function() { if (isMobile && $(this).scrollTop() >= 480) { // If mobile device and page is scrolled more than 520px.