1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added handling of full URLs of items and not just the ID.

This commit is contained in:
Uncled1023 2017-02-14 16:49:23 -08:00
parent 20404c829a
commit c5d0f19ed9
3 changed files with 9 additions and 3 deletions

View File

@ -32,6 +32,12 @@
var type = newDiv.find('#item_type').val();
var url = newDiv.find('#item_url').val();
// Try to strip out the ID from the url
var pattern = '(?:(?:.+)\\/)?([^\\?]+)(?:\\?(?:.*))?';
var reg = new RegExp(pattern);
var match = reg.exec(url);
url = match[1];
// First Validation
if (title == null || title == '') {
newDiv.find("#item_error").show();

View File

@ -61,8 +61,8 @@
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="item_url"><h4>URL Id</h4></label>
<input class="form-control" name="item_url" id="item_url" placeholder="XXXXX" title="enter the url id for the item" type="text" />
<label for="item_url"><h4>Url or Id</h4></label>
<input class="form-control" name="item_url" id="item_url" placeholder="https://service.teknik.io/XXXXX or XXXXX" title="enter the url id for the item" type="text" />
</div>
</div>
</div>

View File

@ -69,7 +69,7 @@ namespace Teknik
catch (Exception ex)
{
// Just log it
Logging.Logger.WriteEntry(ex);
Logging.Logger.WriteEntry(Logging.LogLevel.Warning, "Error in Application_EndRequest", ex);
}
}