Browse Source

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

pull/50/head
Teknikode 6 years ago
parent
commit
c5d0f19ed9
  1. 6
      Teknik/Areas/Vault/Scripts/Vault.js
  2. 4
      Teknik/Areas/Vault/Views/Vault/NewVault.cshtml
  3. 2
      Teknik/Global.asax.cs

6
Teknik/Areas/Vault/Scripts/Vault.js

@ -32,6 +32,12 @@ @@ -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();

4
Teknik/Areas/Vault/Views/Vault/NewVault.cshtml

@ -61,8 +61,8 @@ @@ -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>

2
Teknik/Global.asax.cs

@ -69,7 +69,7 @@ namespace Teknik @@ -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);
}
}

Loading…
Cancel
Save