Code Monkey home page Code Monkey logo

cryptic-crossword's Introduction

Hello world! ๐Ÿ‘‹
My name is David and I'm a Software Engineer.
Over here you'll find some side projects I work on from time to time.

Featured Projects

pytai The Last Word hTXT Viewer Bonus Board State Editor Cryptic Crossword Crossword Solver CTFs Writeup Feed Filter Home Finder Home Finder Extension Toddler Jukebox RgEdt

cryptic-crossword's People

Contributors

actions-user avatar dvd848 avatar udyh avatar

Stargazers

 avatar

Watchers

 avatar

cryptic-crossword's Issues

Add an option to share the crossword between browsers

I checked it and it very simple. Attached some code for example.
The question is where to put the "share" button".

diff --git a/src/Display.ts b/src/Display.ts
index 1cd72fe..318fd3d 100644
--- a/src/Display.ts
+++ b/src/Display.ts
@@ -58,6 +58,7 @@ class StorageContext
     private readonly LOCAL_STORAGE_VCN_KEY = "VCN";
     private readonly LOCAL_STORAGE_VCN_VAL = "1";
     private readonly LOCAL_STORAGE_KEY_PREFIX = "crossword_";
+    private readonly LOCAL_STORAGE_URL_PARAM = this.LOCAL_STORAGE_KEY_PREFIX + "data";
 
     constructor(crossword_id: number, rows: number, cols: number)
     {
@@ -84,8 +85,15 @@ class StorageContext
 
     private loadInput()
     {
-        const input = localStorage.getItem(this.local_storage_key);
-
+        let input = localStorage.getItem(this.local_storage_key);
+       if (input == null || input == ""){
+            const urlParams = new URLSearchParams(window.location.search);
+            input = "";
+            if (urlParams.has(this.LOCAL_STORAGE_URL_PARAM)) {                
+               input = decodeURIComponent(urlParams.get(this.LOCAL_STORAGE_URL_PARAM));        
+            }
+        }
+        
         try
         {
             if (input == null || input == "")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.