This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (?:^|\/|\\)(?:[a-zA-Z0-9\s\-\_])*\.[a-zA-Z]*$ | |
| This will check just the filename in a file upload and ignore the file path before the file name. | |
| This will allow any filename with letters, numbers, dashes, underscores and spaces. | |
| Use in jquery validator like this: | |
| $.validator.addMethod("fileName", function(value, element) { | |
| return this.optional(element) || /(?:^|\/|\\)(?:[a-zA-Z0-9\s\-\_])*\.[a-zA-Z]*$/.test(value); | |
| }, "File names can only contain letters, numbers, dashes, and underscores (and spaces)."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* via https://github.com/jackmoore/colorbox/issues/158 */ | |
| /* Colorbox resize function */ | |
| var resizeTimer; | |
| function resizeColorBox() | |
| { | |
| if (resizeTimer) clearTimeout(resizeTimer); | |
| resizeTimer = setTimeout(function() { | |
| if (jQuery('#cboxOverlay').is(':visible')) { | |
| jQuery.colorbox.resize({width:'80%', height:'80%', maxWidth:700, maxWidth:500}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // open all external links in a new tab/window | |
| $("a[href^='http']:not([href*='" + "<w:account key='domain' />" + "'])").addClass("external").attr({ target: "_blank" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //The html would be: | |
| //<div class="login"> | |
| // <span class="member_controls_login"><a href="/login">Member Login</a></span> | |
| // <span class="member_controls" style="display:none;"><a href='/edit-profile'>Edit profile</a> | <a href='/logout'>Logout</a></span> | |
| //</div> | |
| //display member controls | |
| if((WebvantaAdmin.getUIRValue("r")=="member")||(WebvantaAdmin.getUIRValue("r")=="admin")||(WebvantaAdmin.getUIRValue("r")=="content editor")) { | |
| $(".member_name").text(WebvantaAdmin.getUIRValue("name")); |