Added button and js for shortcode generation
This commit is contained in:
@@ -23,7 +23,7 @@ timestamp_runtime: datetime = datetime.now().strftime("%d%b%y-%H:%M")
|
|||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
filename=f"logs/kjv-api_{datetime.now().strftime('%d%b%y')}.log",
|
filename=f"logs/kjv-api_{datetime.now().strftime('%d%b%y')}.log",
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
level=logging.DEBUG,
|
level=logging.INFO,
|
||||||
)
|
)
|
||||||
|
|
||||||
logging.info(f"Started: {timestamp_runtime}")
|
logging.info(f"Started: {timestamp_runtime}")
|
||||||
|
|||||||
@@ -13,10 +13,23 @@
|
|||||||
<input type="submit" value="Search">
|
<input type="submit" value="Search">
|
||||||
<input type="hidden" name="view" value="rich">
|
<input type="hidden" name="view" value="rich">
|
||||||
</form>
|
</form>
|
||||||
|
<button onclick="make_shortcode()">Get Shortcode: </button>
|
||||||
|
<a id="context_href" href=''></a>
|
||||||
|
<br>
|
||||||
←
|
←
|
||||||
<a href="{prev_chapter_link}">{prev_chapter_name}</a> |
|
<a href="{prev_chapter_link}">{prev_chapter_name}</a> |
|
||||||
{current_chapter_name} |
|
{current_chapter_name} |
|
||||||
<a href="{next_chapter_link}">{next_chapter_name}</a>
|
<a href="{next_chapter_link}">{next_chapter_name}</a>
|
||||||
→
|
→
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
function make_shortcode(){{
|
||||||
|
var xmlHttp = new XMLHttpRequest();
|
||||||
|
var theUrl = "/mksc/" + document.getElementById("searchBar").value;
|
||||||
|
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
|
||||||
|
xmlHttp.send( null );
|
||||||
|
document.getElementById("context_href").innerHTML = xmlHttp.responseText;
|
||||||
|
document.getElementById('context_href').setAttribute("href", "/" + xmlHttp.responseText);
|
||||||
|
}}
|
||||||
|
</script>
|
||||||
</header>
|
</header>
|
||||||
Reference in New Issue
Block a user