Browse Source

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

tags/2.0.6
Teknikode 3 years ago
parent
commit
c5d0f19ed9

+ 6
- 0
Teknik/Areas/Vault/Scripts/Vault.js 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();

+ 2
- 2
Teknik/Areas/Vault/Views/Vault/NewVault.cshtml 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>

+ 1
- 1
Teknik/Global.asax.cs 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);
}
}


Loading…
Cancel
Save