├── README.md ├── ajaxed ├── ajaxed.asp ├── changes.txt ├── class_JSON │ ├── JSON.asp │ ├── test_JSON.asp │ └── test_JSON_standalone.asp ├── class_MD5 │ ├── md5.asp │ └── test_md5.asp ├── class_RSS │ ├── RSS.asp │ ├── class_RSSItem.asp │ └── test_rss.asp ├── class_SHA256 │ ├── sha256.asp │ └── test_sha256.asp ├── class_ajaxedPage │ ├── ajaxed.js │ ├── ajaxedPage.asp │ ├── footer.asp │ ├── header.asp │ └── test_ajaxed.asp ├── class_cache │ ├── cache.asp │ └── test_cache.asp ├── class_dataContainer │ ├── dataContainer.asp │ └── test_dataContainer.asp ├── class_database │ ├── database.asp │ ├── mssql.sql │ ├── test.mdb │ ├── test.sqlite │ ├── testDatabases.asp │ └── test_database.asp ├── class_datatable │ ├── class_datatableColumn.asp │ ├── class_datatableRow.asp │ ├── datatable.asp │ ├── datatable.css │ └── datatable.js ├── class_dropdown │ ├── class_dropdownItem.asp │ ├── dropdown.asp │ └── test_dropdown.asp ├── class_email │ ├── email.asp │ ├── test_attachment.txt │ └── test_email.asp ├── class_library │ ├── library.asp │ └── test_library.asp ├── class_localization │ ├── localization.asp │ └── test_localization.asp ├── class_logger │ ├── logger.asp │ └── test_logger.asp ├── class_stringBuilder │ ├── stringBuilder.asp │ └── test_stringBuilder.asp ├── class_stringOperations │ ├── stringOperations.asp │ └── test_stringOperations.asp ├── class_testFixture │ ├── testFixture.asp │ ├── test_file.txt │ ├── test_testFixture.asp │ └── testfile.asp ├── class_textTemplate │ ├── TextTemplate.asp │ ├── class_TextTemplateBlock.asp │ ├── testTemplate.template │ └── test_textTemplate.asp ├── class_uploader │ └── uploader.asp ├── class_validator │ ├── test_validator.asp │ └── validator.asp ├── config.asp ├── console │ ├── configuration.asp │ ├── console.js │ ├── default.asp │ ├── documentation.asp │ ├── documentor │ │ ├── code_highlight.css │ │ ├── config.asp │ │ ├── default.asp │ │ ├── highlight │ │ │ ├── AUTHORS.en.txt │ │ │ ├── AUTHORS.ru.txt │ │ │ ├── LICENSE │ │ │ ├── export.html │ │ │ ├── highlight.js │ │ │ ├── languages │ │ │ │ ├── 1c.js │ │ │ │ ├── axapta.js │ │ │ │ ├── bash.js │ │ │ │ ├── diff.js │ │ │ │ ├── dos.js │ │ │ │ ├── dynamic.js │ │ │ │ ├── ini.js │ │ │ │ ├── javascript.js │ │ │ │ ├── lisp.js │ │ │ │ ├── mel.js │ │ │ │ ├── profile.js │ │ │ │ ├── renderman.js │ │ │ │ ├── smalltalk.js │ │ │ │ ├── sql.js │ │ │ │ ├── static.js │ │ │ │ ├── vbscript.js │ │ │ │ └── www.js │ │ │ ├── readme.eng.txt │ │ │ ├── readme.rus.txt │ │ │ ├── styles │ │ │ │ ├── ascetic.css │ │ │ │ ├── dark.css │ │ │ │ ├── default.css │ │ │ │ ├── far.css │ │ │ │ ├── homesite.css │ │ │ │ ├── idea.css │ │ │ │ ├── sunburst.css │ │ │ │ ├── vs.css │ │ │ │ └── zenburn.css │ │ │ ├── test.html │ │ │ └── wp_highlight.js.php │ │ ├── icon.png │ │ ├── manual.asp │ │ ├── style.xsl │ │ └── style_new.xsl │ ├── img │ │ ├── fav.png │ │ └── tab-round.png │ ├── logFile.asp │ ├── logs.asp │ ├── regex.asp │ ├── screen_borderstyles.css │ ├── source.asp │ ├── std.css │ ├── templates.asp │ ├── templatesList.asp │ ├── test_console.asp │ ├── tests.asp │ └── version.asp ├── demo │ └── default.asp ├── developer.txt ├── index.html ├── installation.txt ├── license.txt ├── logo.png ├── poweredby.png ├── prototypejs │ └── prototype.js └── script.aculo.us │ ├── builder.js │ ├── controls.js │ ├── dragdrop.js │ ├── effects.js │ ├── scriptaculous.js │ ├── slider.js │ ├── sound.js │ └── unittest.js ├── ajaxedConfig ├── config.asp ├── footer.asp └── header.asp └── misc project files ├── Settings [080807_1015].uec ├── TODO.txt ├── ajaxed.MICHAL.Michal.pui ├── ajaxed.prj └── logo.pdn /README.md: -------------------------------------------------------------------------------- 1 | ASP Ajaxed is a free Classic ASP library with built-in AJAX support. 2 | 3 | It rapidly lets you build modern web applications according to current web standards. 4 | 5 | The ASP Ajaxed Library comes up with a unique AJAX technique which can be used within your classic ASP applications. You will be able to create rich web applications with little effort. 6 | 7 | * Full AJAX support (calling server side function directly) 8 | * No low level AJAX skills required 9 | * No components installation required 10 | * Easy installation in less than 3 minutes 11 | * Short learning curve (about 20 minutes) 12 | * Includes common components such as Datagrid, RSS, Validator, Cache, etc. 13 | * Uses one of the most popular Javascript Libraries: prototypejs 14 | * Object Oriented (OO) Approach 15 | * Includes a complete ASP JSON generator. 16 | * Additionally it includes a handful useful functions and components 17 | * Free for use (LGPL license) 18 | 19 | The official website is at http://www.asp-ajaxed.org/ 20 | -------------------------------------------------------------------------------- /ajaxed/ajaxed.asp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <% 12 | set lib = new Library 13 | set lib.logger = new Logger 14 | set local = new Localization 15 | set str = new StringOperations 16 | set db = new Database 17 | %> -------------------------------------------------------------------------------- /ajaxed/class_JSON/test_JSON.asp: -------------------------------------------------------------------------------- 1 |  2 | <% AJAXED_CONNSTRING = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath("../class_database/test.mdb") & ";" %> 3 | <% 4 | class Person 5 | public firstname ''[string] firstname 6 | public lastname ''[string] lastname 7 | public favNumbers ''[array] persons favorite numbers 8 | public function reflect() 9 | set reflect = server.createObject("scripting.dictionary") 10 | with reflect 11 | .add "firstname", firstname 12 | .add "lastname", lastname 13 | .add "favNumbers", favNumbers 14 | end with 15 | end function 16 | end class 17 | 18 | set db = new Database 19 | 20 | set tf = new TestFixture 21 | tf.run() 22 | 23 | 24 | sub test_1() 25 | 'just for completion, that it is a test and generates output 26 | db.open(AJAXED_CONNSTRING) 27 | end sub 28 | 29 | 30 | set p = new Person 31 | p.firstname = "John" 32 | p.lastname = "Doe" 33 | p.favNumbers = array(2, 7, 234) 34 | set aDict = server.createObject("scripting.dictionary") 35 | aDict.add "a", 2.2342348 36 | aDict.add "b", array(7, 8, array(9, 5)) 37 | aDict.add "c", p 38 | aDict.add "f", db.getRecordset("SELECT * FROM person ORDER BY created_on") 39 | aDict.add "g", db.getRecordset("SELECT * FROM person WHERE firstname = 'sbas' ORDER BY created_on") 40 | 41 | set rs = db.getRecordset("SELECT * FROM person ORDER BY created_on") 42 | set empty_rs = db.getRecordset("SELECT * FROM person WHERE firstname = 'sbas' ORDER BY created_on") 43 | %> 44 | 95 | -------------------------------------------------------------------------------- /ajaxed/class_JSON/test_JSON_standalone.asp: -------------------------------------------------------------------------------- 1 | <% 2 | 'the JSON class is used also as a standalone component on webdevbros.net 3 | 'and it also supports option explicit .. thus those tests 4 | option explicit 5 | %> 6 | 7 | <% 8 | dim output, data, multi(1, 1), dict, RS 9 | multi(0, 0) = "x" 10 | multi(0, 1) = 7 11 | multi(1, 0) = null 12 | set dict = server.createObject("scripting.dictionary") 13 | dict.add "some", "x" 14 | dict.add "other", array(new JSON) 15 | 16 | data = array(array(1, false), 1.2, null, nothing, multi, dict) 17 | output = (new JSON)("root", data, false) 18 | %> -------------------------------------------------------------------------------- /ajaxed/class_MD5/test_md5.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set tf = new TestFixture 5 | tf.run() 6 | 7 | sub test_1() 8 | set h = new MD5 9 | tf.assert h.hash("md5isnice") = "712a84bd75495d12946129e2bc34d4b7", "hash must be generated correctly." 10 | end sub 11 | %> -------------------------------------------------------------------------------- /ajaxed/class_RSS/class_RSSItem.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: RSSItem 5 | '' @CREATOR: Michal Gabrukiewicz 6 | '' @CREATEDON: 2006-11-08 18:15 7 | '' @CDESCRIPTION: used with the RSSReader 8 | '' @REQUIRES: - 9 | '' @FRIENDOF: RSS 10 | '' @VERSION: 0.1 11 | 12 | '************************************************************************************************************** 13 | class RSSItem 14 | 15 | 'public members 16 | public title ''[string] title of the item 17 | public description ''[string] content 18 | public category ''[string] name of the category 19 | public link ''[string] link to the item 20 | public comments ''[string] link to the comments of the item (if available) 21 | public GUID ''[string] an unique identifier for the item. usually the same as link 22 | public author ''[string] author of the item 23 | public publishedDate ''[date] date when the item has been published. your local timezone. 24 | 25 | '********************************************************************************************************** 26 | '* constructor 27 | '********************************************************************************************************** 28 | public sub class_initialize() 29 | end sub 30 | 31 | '********************************************************************************************************** 32 | '' @SDESCRIPTION: reflection of the properties and its values 33 | '' @RETURN: [dictionary] key = property-name, value = property value 34 | '********************************************************************************************************** 35 | public function reflect() 36 | set reflect = server.createObject("scripting.dictionary") 37 | with reflect 38 | .add "title", title 39 | .add "description", description 40 | .add "category", category 41 | .add "link", link 42 | .add "comments", comments 43 | .add "GUID", guid 44 | .add "author", author 45 | .add "publishedDate", publishedDate 46 | end with 47 | end function 48 | 49 | end class 50 | %> -------------------------------------------------------------------------------- /ajaxed/class_RSS/test_rss.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set tf = new TestFixture 5 | tf.run() 6 | 7 | sub test_1() 8 | set r = new RSS 9 | r.url = "http://www.webdevbros.net/feed/" 10 | r.load() 11 | if r.failed then 12 | tf.info("Could not load the webdevbros feed. Maybe no internet connection available") 13 | else 14 | tf.assert r.title <> "", "title of the feed must be set" 15 | tf.assert r.items.count > 0, "there must be some blog posts" 16 | end if 17 | end sub 18 | 19 | sub test_2() 20 | set r = new RSS 21 | r.url = "http://www.grafix.at/ajaxed/console/version.asp" 22 | r.load() 23 | if r.failed then 24 | tf.info("Could not load the ajaxed version feed. Maybe no internet connection available") 25 | else 26 | tf.assertEqual "ajaxed version feed", r.title, "title of the feed does not match" 27 | tf.assert r.description <> "", "version released text must be there" 28 | end if 29 | end sub 30 | %> -------------------------------------------------------------------------------- /ajaxed/class_SHA256/test_sha256.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set tf = new TestFixture 5 | tf.run() 6 | 7 | sub test_1() 8 | set h = new SHA256 9 | tf.assert h.hash("The quick brown fox jumps over the lazy dog") = "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592", "hash must be generated correctly." 10 | end sub 11 | %> -------------------------------------------------------------------------------- /ajaxed/class_ajaxedPage/ajaxed.js: -------------------------------------------------------------------------------- 1 | function ajaxed() {} 2 | 3 | ajaxed.prototype.indicator = Element.extend(document.createElement('div')).addClassName('ajaxLoadingIndicator'); 4 | 5 | //registers the loading indicator 6 | Ajax.Responders.register({ 7 | onCreate: function() { 8 | var s = ajaxed.prototype.indicator.style; 9 | s.position = 'fixed'; 10 | s.top = '0px'; 11 | s.right = '0px'; 12 | if (Ajax.activeRequestCount == 1) document.body.appendChild(ajaxed.prototype.indicator); 13 | }, 14 | onComplete: function() { 15 | if (Ajax.activeRequestCount == 0) document.body.removeChild(ajaxed.prototype.indicator); 16 | } 17 | }); 18 | 19 | //optional: url (also because of bug in iis5 http://support.microsoft.com/kb/216493) 20 | ajaxed.callback = function(theAction, func, params, onComplete, url) { 21 | if (params) { 22 | params = $H(params); 23 | } else { 24 | if ($('frm')) { 25 | params = $H($('frm').serialize(true)); 26 | } else { 27 | params = new Hash(); 28 | } 29 | } 30 | params = params.merge({PageAjaxed: theAction}); 31 | uri = window.location.href.replace(/#.*$/ig, ''); 32 | if (ajaxed.prototype.debug) ajaxed.debug("Action (to be handled in callback):\n\n" + theAction); 33 | if (uri.endsWith('/') && url) uri += url; 34 | if (url) uri = url; 35 | if (ajaxed.prototype.debug) ajaxed.debug("URL called:\n\n" + uri); 36 | if (ajaxed.prototype.debug) ajaxed.debug("Params passed to xhr:\n\n" + params.toJSON()); 37 | new Ajax.Request(uri, { 38 | method: 'post', 39 | parameters: params.toQueryString(), 40 | requestHeaders: {Accept: 'application/json'}, 41 | onSuccess: function(trans) { 42 | if (ajaxed.prototype.debug) ajaxed.debug("Response on callback:\n\n" + trans.responseText); 43 | if (!trans.responseText.startsWith('{ "root":') && 44 | !trans.responseText.startsWith('pagePart:')) { 45 | ajaxed.callbackFailure(trans); 46 | } else if (trans.responseText.startsWith('pagePart:')) { 47 | var content = trans.responseText.replace(/^pagePart:/g, ''); 48 | if (typeof func == "string") return $(func).update(content); 49 | if (func) func(content); 50 | } else { 51 | if (func) func(trans.responseText.evalJSON(true).root); 52 | } 53 | }, 54 | onFailure: ajaxed.callbackFailure, 55 | onComplete: onComplete 56 | }); 57 | } 58 | ajaxed.callbackFailure = function(transport) { 59 | friendlyMsg = transport.responseText; 60 | friendlyMsg = friendlyMsg.replace(new RegExp("()|()", "gi"), ""); 61 | friendlyMsg = friendlyMsg.stripTags(); 62 | friendlyMsg = friendlyMsg.replace(new RegExp("[\\s]+", "gi"), " "); 63 | alert(friendlyMsg); 64 | } 65 | ajaxed.debug = function(msg){ 66 | alert("\n\n" + msg); 67 | } 68 | 69 | // Returns the location and the size of the square 70 | // which is shown to the user (windowscroll) 71 | // Core code from - quirksmode.org 72 | ajaxed.getWindowScroll = function(parent){ 73 | var T, L, W, H; 74 | parent = parent || document.body; 75 | if (parent != document.body) { 76 | T = parent.scrollTop; 77 | L = parent.scrollLeft; 78 | W = parent.scrollWidth; 79 | H = parent.scrollHeight; 80 | } else { 81 | var w = window; 82 | with (w.document) { 83 | if (w.document.documentElement && documentElement.scrollTop) { 84 | T = documentElement.scrollTop; 85 | L = documentElement.scrollLeft; 86 | } else { 87 | if (w.document.body) { 88 | T = body.scrollTop; 89 | L = body.scrollLeft; 90 | } 91 | } 92 | if (w.innerWidth) { 93 | W = w.innerWidth; 94 | H = w.innerHeight; 95 | } else { 96 | if (w.document.documentElement && documentElement.clientWidth) { 97 | W = documentElement.clientWidth; 98 | H = documentElement.clientHeight; 99 | } else { 100 | W = body.offsetWidth; 101 | H = body.offsetHeight 102 | } 103 | } 104 | } 105 | } 106 | return { 107 | top: T, 108 | left: L, 109 | width: W, 110 | height: H 111 | }; 112 | } -------------------------------------------------------------------------------- /ajaxed/class_ajaxedPage/footer.asp: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /ajaxed/class_ajaxedPage/header.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <%= title %> 6 | <% 'if there is a header sub, then it will be called. e.g. for custom styles, etc. %> 7 | <% ajaxedHeader(array()) %> 8 | <% lib.exec "header", empty %> 9 | 10 | -------------------------------------------------------------------------------- /ajaxed/class_ajaxedPage/test_ajaxed.asp: -------------------------------------------------------------------------------- 1 |  2 | <% AJAXED_CONNSTRING = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath("../class_database/test.mdb") & ";" %> 3 | <% 4 | 'This page performs several tests in order to check the 5 | 'correct functionality of AJAXED. 6 | 'dont change anything!!! 7 | 8 | initialized = false 9 | 10 | class foo 11 | public name, age, country, favs 12 | function reflect() 13 | set reflect = lib.newDict(empty) 14 | reflect.add "name", me.name 15 | reflect.add "age", me.age 16 | reflect.add "Country", me.country 17 | reflect.add "favs", me.favs 18 | end function 19 | end class 20 | 21 | class fooUnknown 22 | end class 23 | 24 | set p = new AjaxedPage 25 | p.plain = true 26 | p.dbconnection = true 27 | p.onlyDev = true 28 | 29 | set tf = new TestFixture 30 | tf.run() 31 | 32 | sub test_1 33 | p.draw() 34 | end sub 35 | 36 | 37 | sub init() 38 | if request.querystring = "" and p.QS(empty) <> "" then p.error("No querystring should be here") 39 | 40 | initialized = true 41 | end sub 42 | 43 | sub callback(action) 44 | if not p.isPostback() then p.error("Must be postpack!") 45 | if not initialized then p.error("init() has not been exectuted") 46 | 47 | select case action 48 | case "bool" 49 | p.returnValue "t", true 50 | p.returnValue "f", false 51 | case "number" 52 | p.return(10) 53 | case "float" 54 | p.return(10.99) 55 | case "nothings" 56 | p.return(array(null, nothing, empty)) 57 | case "string" 58 | p.returnValue "ABC", "ABC" 59 | p.returnValue "special", "äöü'""?!\/[]_²§()~" 60 | case "object" 61 | set f = new foo 62 | f.name = "michal" 63 | f.age = 26 64 | f.country = "austria" 65 | p.returnValue "custom", f 66 | p.returnValue "unknown", new fooUnknown 67 | case "object_simple" 68 | set f = new foo 69 | f.name = "michal" 70 | f.age = 26 71 | f.country = "austria" 72 | f.favs = array(2, 3, 4, "s") 73 | p.return(f) 74 | case "dict" 75 | p.return((new foo).reflect()) 76 | case "dict2" 77 | set d1 = (new foo).reflect() 78 | p.returnValue "d1", d1 79 | set d2 = server.createObject("scripting.dictionary") 80 | d2.add "arr", array(2, 3, false) 81 | d2.add "d1", d1 82 | p.returnValue "d2", d2 83 | case "rs" 84 | set rs = db.getRecordset("SELECT * FROM person ORDER BY created_on") 85 | p.return(rs) 86 | case "rs_count" 87 | set rs = db.getUnlockedRecordset("SELECT * FROM person ORDER BY created_on") 88 | p.returnValue "data", rs 89 | p.returnValue "count", rs.recordCount 90 | case "empty_rs" 91 | set rs = db.getRecordset("SELECT * FROM person WHERE firstname = 'asdajs' ORDER BY created_on") 92 | p.return(rs) 93 | end select 94 | end sub 95 | 96 | sub main() %> 97 | 98 | <% 99 | tf.assertEqual lib.page.loadPrototypeJS, true, "prototypeJS must be loaded by default" 100 | tf.assert not p.isPostback(), "No postback possible here!" 101 | tf.assert initialized, "init() has not been exectuted" 102 | %> 103 | 104 | 180 | 181 |
182 | 183 | 198 | 199 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/class_cache/cache.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | '* License refer to license.txt 4 | '************************************************************************************************************** 5 | 6 | '************************************************************************************************************** 7 | 8 | '' @CLASSTITLE: Cache 9 | '' @CREATOR: Michal Gabrukiewicz 10 | '' @CREATEDON: 2006-11-10 15:46 11 | '' @CDESCRIPTION: Lets you cache values, objects, etc. It uses the application-variables and 12 | '' therefore the cache will be shared with all other users. it can cash items which are 13 | '' identified by an Identifier. The cache will be identified by its name 14 | '' The cache is protected against memory problems. e.g. huge contents wont be cached, 15 | '' cache has a limited size. so that the server is not to busy you can define how the caching 16 | '' works for a specific thing. e.g. you want to cache RSS Feeds then you can setup that the 17 | '' cache for RSS will hold a maximum of 10 RSS feeds shared. The organisation of the cache is done 18 | '' automatically if the maximum amount of items is reached 19 | '' @REQUIRES: - 20 | '' @VERSION: 0.1 21 | 22 | '************************************************************************************************************** 23 | class Cache 24 | 25 | 'private members 26 | private prefix 27 | 28 | private property get cachebase 'returns a dictionary which represents the cache. key = name of the cache. value = array(expires, HTML) 29 | set cachebase = nothing 30 | if not isArray(application(prefix & name)) then 31 | application.lock() 32 | application(prefix & name) = array(server.createObject("scripting.dictionary")) 33 | application.unlock() 34 | end if 35 | 36 | set cachebase = application(prefix & name)(0) 37 | end property 38 | 39 | 'public members 40 | public name ''[string] name of the cache you want to create. normally a word which describes what it is caching 41 | public interval ''[string] what interval is used to define the expiration of the items. default = h (hour) 42 | ''allowed values are all values which can be used with dateadd() function. e.g. m = month, etc. 43 | public intervalValue ''[string] which value of the interval. default = 1 44 | public maxSlots ''[string] the maximum amount of slots for caching items. default = 10 45 | public maxItemSize ''[string] the maximum size in bytes of an item which will be cached. all items with a size 46 | ''bigger than this value wont be cached (saving memory on the server). default = 100000 47 | ''works only if the items are no objects and no arrays 48 | 49 | '********************************************************************************************************** 50 | '* constructor 51 | '********************************************************************************************************** 52 | public sub class_initialize() 53 | name = "" 54 | interval = "h" 55 | intervalValue = 1 56 | maxSlots = 10 57 | maxItemSize = 100000 58 | prefix = "GL_Cache_" 59 | end sub 60 | 61 | '********************************************************************************************************** 62 | '' @SDESCRIPTION: stores an item into the cache. if it already exists then it gets overwritten 63 | '' @PARAM: identifier [string]: the identifier for the item. with this you can get the item afterwards 64 | '' @PARAM: item [variant]: something you want to store within the cache. 65 | '' Note: Objects does not work!! 66 | '********************************************************************************************************** 67 | public sub store(identifier, item) 68 | if name = "" then lib.error("ICE 4598: Name is needed for caching.") 69 | 70 | 'check the size only for strings... 71 | if not isObject(item) and not isArray(item) then 72 | if len(item) > maxItemSize then exit sub 73 | end if 74 | 75 | set c = cachebase 76 | expires = dateadd(interval, intervalValue, now()) 77 | packedItem = array(expires, item) 78 | 'if it exists then remove and add to the end 79 | application.lock() 80 | if c.exists(identifier) then c.remove(identifier) 81 | c.add identifier, packedItem 82 | application.unlock() 83 | reOrganize() 84 | end sub 85 | 86 | '********************************************************************************************************** 87 | '' @SDESCRIPTION: clears the cache. 88 | '********************************************************************************************************** 89 | public sub clear() 90 | set c = cachebase 91 | application.lock() 92 | c.removeAll() 93 | application.unlock() 94 | end sub 95 | 96 | '********************************************************************************************************** 97 | '' @SDESCRIPTION: gets an item from the cache. 98 | '' @PARAM: identifier [string]: identifier of the item within the cache 99 | '' @RETURN: [variant] empty if no value found, otherwise the value. 100 | '********************************************************************************************************** 101 | public function getItem(identifier) 102 | set c = cachebase 103 | if (c.exists(identifier)) then 104 | cachedItem = c(identifier) 105 | if not itemExpired(cachedItem) then 106 | getItem = cachedItem(1) 107 | else 108 | 'if expired then remove immediately 109 | application.lock() 110 | c.remove(identifier) 111 | application.unlock() 112 | end if 113 | end if 114 | end function 115 | 116 | '********************************************************************************************************** 117 | '* reOrganize 118 | '********************************************************************************************************** 119 | private sub reOrganize() 120 | set c = cachebase 121 | 'if the cache is full, then we remove all expired. 122 | 'when no expired found we have to remove the first one 123 | if c.count > maxSlots then 124 | removedAtLeastOne = false 125 | for each identifier in c.keys 126 | rf = c(identifier) 127 | if itemExpired(rf) then 128 | application.lock() 129 | c.remove(identifier) 130 | application.unlock() 131 | removedAtLeastOne = true 132 | end if 133 | next 134 | 'if no one could be removed because no one is expired yet, 135 | 'then we have to remove the first one 136 | if not removedAtLeastOne then 137 | identifiers = c.keys 138 | application.lock() 139 | c.remove(identifiers(0)) 140 | application.unlock() 141 | end if 142 | end if 143 | end sub 144 | 145 | '********************************************************************************************************** 146 | '* itemExpired 147 | '********************************************************************************************************** 148 | private function itemExpired(cachedItemArray) 149 | itemExpired = (cachedItemArray(0) < now()) 150 | end function 151 | 152 | end class 153 | %> -------------------------------------------------------------------------------- /ajaxed/class_cache/test_cache.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set tf = new TestFixture 5 | tf.run() 6 | 7 | sub test_1() 8 | set cash = new Cache 9 | with cash 10 | .name = "test" 11 | .interval = "s" 12 | .intervalValue = 10 13 | .store "val", 10 14 | tf.assert str.parse(.getItem("val"), 0) = 10, "" 15 | end with 16 | end sub 17 | %> 18 | -------------------------------------------------------------------------------- /ajaxed/class_database/mssql.sql: -------------------------------------------------------------------------------- 1 | /** 2 | 1. Create a database with the name: ajaxedtest 3 | 2. Execute the following script 4 | 3. Run Database tests within ajaxedconsole 5 | **/ 6 | 7 | USE [ajaxedtest] 8 | GO 9 | SET ANSI_NULLS ON 10 | GO 11 | SET QUOTED_IDENTIFIER ON 12 | GO 13 | CREATE TABLE [dbo].[person]( 14 | [id] [int] IDENTITY(1,1) NOT NULL, 15 | [firstname] [nvarchar](255) NULL, 16 | [lastname] [nvarchar](255) NULL, 17 | [age] [int] NULL, 18 | [cool] [tinyint] NULL, 19 | CONSTRAINT [PK_person] PRIMARY KEY CLUSTERED 20 | ( 21 | [id] ASC 22 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 23 | ) ON [PRIMARY] 24 | 25 | /** 26 | Data 27 | **/ 28 | 29 | INSERT INTO [ajaxedtest].[dbo].[person] VALUES ('Michal','Gabrukiewicz','26','0'); 30 | INSERT INTO [ajaxedtest].[dbo].[person] VALUES ('cool','and the gang','48','1'); -------------------------------------------------------------------------------- /ajaxed/class_database/test.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/class_database/test.mdb -------------------------------------------------------------------------------- /ajaxed/class_database/test.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/class_database/test.sqlite -------------------------------------------------------------------------------- /ajaxed/class_database/testDatabases.asp: -------------------------------------------------------------------------------- 1 | <% 2 | 'connection strings for all the test databases 3 | TEST_DB_ACCESS = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath(lib.path("class_database/test.mdb")) & ";" 4 | TEST_DB_SQLITE = "DRIVER=SQLite3 ODBC Driver;Database=" & server.mappath(lib.path("class_database/test.sqlite")) & ";LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;" 5 | TEST_DB_MSSQL = "Provider=sqloledb;Data Source=(local);Initial Catalog=ajaxedtest;Trusted_Connection=yes" 6 | TEST_DB_MYSQL = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=ajaxedtest;User=root;Option=3;" 7 | TEST_DB_POSTGRESQL = "Driver={PostgreSQL UNICODE};Server=localhost;Port=5432;Database=ajaxedtests;Uid=username;Pwd=password;" 8 | %> -------------------------------------------------------------------------------- /ajaxed/class_datatable/class_datatableRow.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: DatatableRow 5 | '' @CREATOR: michal 6 | '' @CREATEDON: 2008-06-17 15:56 7 | '' @CDESCRIPTION: Represents a row in a datatable. Can only be accessed when using 8 | '' the onRowCreated event of the Datatable. When the event is raised its 9 | '' possible to access the current row with the row property of the Datatable. 10 | '' Example of how to mark first 10 records of a datatable as selected using the row's selected property: 11 | '' 12 | '' <% 13 | '' dt.selection = "multiple" 14 | '' dt.onRowCreated = "onRow" 15 | '' sub onRow(callerDT) 16 | '' . callerDT.row.selected = callerDT.row.number <= 10 17 | '' end sub 18 | '' % > 19 | '' 20 | '' @FRIENDOF: Datatable 21 | '' @VERSION: 0.1 22 | 23 | '************************************************************************************************************** 24 | class DatatableRow 25 | 26 | 'private members 27 | private p_number, p_selected 28 | 29 | 'public members 30 | public dt ''[Datatable] the datatable which contains the row 31 | public cssClass ''[string] css class which will be placed within the <tr> tag 32 | public disabled ''[bool] indicates if the row is disabled or not. disabled does not allow to select the row and it wont be clickable 33 | public attributes ''[string] attributes of the <tr>-tag. You can make e.g. whole rows clickable: onclick="window.location.href='someurl.asp'" 34 | 35 | public property get selected ''[bool] indicates if the row is selected or not. keeps state after postback as well. So when user changes the selection it will remember the selection after postback. 36 | selected = p_selected 37 | if lib.page.isPostback() then selected = ((new DataContainer)(lib.page.RFA(dt.ID))).contains(PK) 38 | end property 39 | 40 | public property let selected(val) ''[bool] 41 | p_selected = val 42 | end property 43 | 44 | public default property get number ''[int] gets the number of the row within the datatable. on paging the number is continously. Good for numbering your records 45 | number = p_number 46 | end property 47 | 48 | public property get ID ''[int] gets a unique ID of the row. the <tr> tag contains this ID 49 | ID = dt.ID & "_row_" & PK 50 | end property 51 | 52 | public property get PK ''[int] gets the primary key value of the rows record 53 | 'TODO: check if the PK is a number and throw a nice understandable error 54 | 'PK = cLng(dt.data.fields(dt.pkColumn)) 55 | ' ^ Commented out while troubleshooting sprocs - fixed, but wondering what the side-effects might be... 56 | PK = dt.data.fields(dt.pkColumn) 57 | end property 58 | 59 | '********************************************************************************************************** 60 | '* constructor 61 | '********************************************************************************************************** 62 | public sub class_initialize() 63 | set dt = nothing 64 | end sub 65 | 66 | '********************************************************************************************************** 67 | '* draw 68 | '********************************************************************************************************** 69 | sub draw(byVal num, byRef currentCol, byRef cols, byRef output) 70 | p_number = num 71 | raiseOnRowCreated() 72 | css = lib.iif(number mod 2 = 0, "axdDTRowEven", "axdDTRowOdd") & " " & _ 73 | lib.iif(selected, "axdDTRowSelected " & cssClass, cssClass) 74 | output("") 75 | drawSelectionColumn false, output 76 | for each currentCol in cols 77 | currentCol.drawData dt.data.fields(currentCol.name), output 78 | next 79 | output("") 80 | end sub 81 | 82 | '****************************************************************************************** 83 | '* raiseOnRowCreated 84 | '****************************************************************************************** 85 | private sub raiseOnRowCreated() 86 | if isEmpty(dt.onRowCreated) then exit sub 87 | set onRowCreatedFunc = lib.getFunction(dt.onRowCreated) 88 | if onRowCreatedFunc is nothing then lib.throwError("Datatable.onRowCreated sub '" & dt.onRowCreated & "' does not exist.") 89 | onRowCreatedFunc(dt) 90 | end sub 91 | 92 | '****************************************************************************************** 93 | '* drawSelectionColumn 94 | '****************************************************************************************** 95 | sub drawSelectionColumn(header, byRef output) 96 | if dt.selection = "" then exit sub 97 | if header then 98 | output("") 99 | else 100 | output("") 101 | if dt.selection = "single" then singl = true 102 | output("") 110 | end if 111 | end sub 112 | 113 | end class 114 | %> -------------------------------------------------------------------------------- /ajaxed/class_datatable/datatable.css: -------------------------------------------------------------------------------- 1 | .axd_dt th.sortedASC { 2 | border-top:5px #000 solid; 3 | } 4 | .axd_dt th.sortedDESC { 5 | border-bottom:5px #000 solid; 6 | } 7 | 8 | tr.axdDTRowSelected td { 9 | background:#FFFFCC; 10 | } 11 | 12 | tr.axdDTControlsRow { 13 | background: #eee; 14 | } 15 | 16 | .axdDTCustomControls { 17 | float:left; 18 | } 19 | .axdDTControls { 20 | float:right; 21 | } 22 | .axdDTHighlight { 23 | background: #FCF232; 24 | } 25 | .axdDTNull { 26 | color:#bbb; 27 | } -------------------------------------------------------------------------------- /ajaxed/class_datatable/datatable.js: -------------------------------------------------------------------------------- 1 | function AxdDT(tID, sorted) { 2 | 3 | this.table = $(tID); 4 | this.sorted = ''; 5 | this.lastSelectedRow; 6 | this.fullsearchQuery = ''; 7 | this.page = 1; 8 | 9 | this.goTo = function(pageNr) { 10 | var t = this; 11 | this.callback('goTo', {axd_dt_page: pageNr}, function(trans) { 12 | t.page = pageNr; 13 | }); 14 | } 15 | 16 | this.setSorted = function(col) { 17 | this.sorted = col.toLowerCase(); 18 | $$('#' + this.table.id + ' th').each(function(el) { 19 | el.removeClassName("sortedASC").removeClassName("sortedDESC"); 20 | }) 21 | this.sorted.split(',').each(function(c) { 22 | c = c.strip(); 23 | var name = c.replace(/ desc$| asc$/ig, '').strip(); 24 | var dir = "ASC"; 25 | if (c.match(/ desc$/i)) dir = "DESC"; 26 | thCol = $$("#" + this.table.id + ' th.axdCol_' + name); 27 | if (thCol.length > 0) thCol[0].addClassName('sorted' + dir); 28 | }, this); 29 | } 30 | this.setSorted(sorted); 31 | 32 | this.callback = function(method, params, onCompleted, container) { 33 | //we pass all other criterias as well, so that everything is remembered 34 | //on the callback the actual params are merged and thus the existing one overriden 35 | var allParams = $H({ 36 | axd_dt_id: this.table.id, 37 | axd_dt_sort: this.sorted, 38 | axd_dt_fullsearch: this.fullsearchQuery, 39 | axd_dt_page: this.page 40 | }); 41 | //also add the record selections 42 | var selected = []; 43 | $$('#' + this.table.id + " .axdDTColSelection input:checked").each(function(el){ 44 | selected.push(el.value); 45 | }) 46 | allParams.set(this.table.id, selected); 47 | var t = this; 48 | ajaxed.callback( 49 | "axd_dt_" + method, 50 | (container) ? container : this.table.id + "_body", 51 | allParams.merge(params), 52 | function(trans) { 53 | //the trick with paging is that the last row of the body is the paging row 54 | //we take it and move it into the footer. 55 | $$('#' + t.table.id + ' tfoot')[0].update($$('#' + t.table.id + '_body > tr:last-child')[0]); 56 | onCompleted(); 57 | } 58 | ); 59 | } 60 | 61 | this.toggleRow = function(rowID, selected, unselectLast) { 62 | var row = $(rowID); 63 | var css = "axdDTRowSelected" 64 | if (unselectLast && this.lastSelectedRow) this.lastSelectedRow.removeClassName(css); 65 | if (selected) row.addClassName(css) 66 | else row.removeClassName(css); 67 | this.lastSelectedRow = row; 68 | } 69 | 70 | this.sort = function(col) { 71 | var dir = "ASC"; 72 | col = col.strip().toLowerCase(); 73 | this.sorted.split(',').each(function(c) { 74 | c = c.strip().toLowerCase(); 75 | var name = c.replace(/ desc$| asc$/ig, '').toLowerCase(); 76 | if (name == col) { 77 | if (c.match(/ desc$/i)) dir = "ASC" 78 | else if (c.match(/ asc$/i)) dir = "DESC" 79 | else dir = "DESC"; 80 | } 81 | }); 82 | var sort = col + ' ' + dir; 83 | var t = this; 84 | this.callback('sort', {axd_dt_sort: sort}, function(trans) { 85 | t.setSorted(sort); 86 | }); 87 | } 88 | 89 | this.search = function(query) { 90 | var t = this; 91 | //when fullsearch is used we need to reset it to page 1. 92 | this.page = 1; 93 | this.callback('fullsearch', {axd_dt_fullsearch: query}, function(trans) { 94 | t.fullsearchQuery = query; 95 | }); 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /ajaxed/class_dropdown/class_dropdownItem.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: DropdownItem 5 | '' @CREATOR: Michal Gabrukiewicz - gabru @ grafix.at 6 | '' @CREATEDON: 2005-02-02 15:16 7 | '' @CDESCRIPTION: represents an item of the dropdown 8 | '' @VERSION: 0.2 9 | '' @FRIENDOF: Dropdown 10 | 11 | '************************************************************************************************************** 12 | class DropdownItem 13 | 14 | 'public members 15 | public index ''[int] index of the item in the dropdown 16 | public value ''[string] value of the item. refers to 17 | public text ''[string] text of the item. refers to the displayed-value of the item 18 | public style ''[string] css-Styles for the item 19 | public title ''[string] title for the option 20 | public selected ''[bool] indicates whether the item is selected or not 21 | public attributes ''[string] additional attributes 22 | public show ''[bool] show the item or not. default = TRUE 23 | public dropdown ''[Dropdown] the dropdown it belongs to. 24 | 25 | '********************************************************************************************************** 26 | '* constructor 27 | '********************************************************************************************************** 28 | public sub class_initialize() 29 | index = -1 30 | value = empty 31 | text = empty 32 | style = empty 33 | title = empty 34 | selected = false 35 | attributes = empty 36 | show = true 37 | set dropdown = nothing 38 | end sub 39 | 40 | '********************************************************************************************************** 41 | '* destructor 42 | '********************************************************************************************************** 43 | private sub class_terminate() 44 | set dropdown = nothing 45 | end sub 46 | 47 | '********************************************************************************************************** 48 | '' @SDESCRIPTION: draws the item using the output of the dropdown 49 | '********************************************************************************************************** 50 | public sub draw() 51 | if show then 52 | dropdown.print(vbTab) 53 | printBeginTag() 54 | printText() 55 | printEndTag() 56 | end if 57 | end sub 58 | 59 | '************************************************************************************************************** 60 | ' printText 61 | '************************************************************************************************************** 62 | private sub printText() 63 | if dropdown.isCommonDropdown() then 64 | dropdown.print(str.HTMLEncode(text)) 65 | else 66 | dropdown.print("") 67 | end if 68 | end sub 69 | 70 | '************************************************************************************************************** 71 | ' printBeginTag 72 | '************************************************************************************************************** 73 | private sub printBeginTag() 74 | if dropdown.isCommonDropdown() then 75 | dropdown.print("") 100 | else 101 | dropdown.print("") 102 | end if 103 | dropdown.print(vbCrLf) 104 | end function 105 | 106 | end class 107 | %> -------------------------------------------------------------------------------- /ajaxed/class_dropdown/test_dropdown.asp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <% 5 | set tf = new TestFixture 6 | tf.debug = true 7 | tf.run() 8 | 9 | 'test with recordset - quick instantiation 10 | sub test_1() 11 | db.open(TEST_DB_SQLITE) 12 | set dd = (new Dropdown)("SELECT * FROM person", "person", 0) 13 | performTests(dd) 14 | end sub 15 | 16 | 'dictionary 17 | sub test_2() 18 | set dd = (new Dropdown)(lib.newDict(array(array(1, "jack"), array(2, "britney"))), _ 19 | "person", 0) 20 | performTests(dd) 21 | end sub 22 | 23 | 'array 24 | sub test_2() 25 | set dd = (new Dropdown)(array("jack", "britney"), _ 26 | "person", 0) 27 | dd.valuesDatasource = array(1, 2) 28 | performTests(dd) 29 | end sub 30 | 31 | sub performTests(drpDown) 32 | 'set some properties to test the properties afterwards 33 | with drpDown 34 | .cssClass = "cssClass" 35 | .id = "someID" 36 | .attributes = "onclick=""alert(2)""" 37 | .style = "color:red" 38 | .onItemCreated = "onItemCreated" 39 | dd = .toString() 40 | end with 41 | msg = "dropdown not rendering properly" 42 | tf.assertMatch "Jack<strong><", dd, msg 46 | tf.assertMatch ">Britney<strong><", dd, msg 47 | tf.assertMatch "name=""person""", dd, msg 48 | tf.assertMatch "class=""cssClass""", dd, msg 49 | tf.assertMatch "id=""someID""", dd, msg 50 | tf.assertMatch "onclick=""alert\(2\)""", dd, msg 51 | tf.assertMatch "style=""color:red""", dd, msg 52 | tf.assertMatch "$", dd, msg 53 | end sub 54 | 55 | sub onItemCreated(it) 56 | 'test if on item created works fine and if item text is being html encoded 57 | it.text = it.text & "" 58 | end sub 59 | %> -------------------------------------------------------------------------------- /ajaxed/class_email/test_attachment.txt: -------------------------------------------------------------------------------- 1 | some common test file -------------------------------------------------------------------------------- /ajaxed/class_email/test_email.asp: -------------------------------------------------------------------------------- 1 | <% AJAXED_EMAIL_COMPONENTS = empty %> 2 | 3 | 4 | <% 5 | allToExists = empty 6 | set tf = new TestFixture 7 | tf.debug = true 8 | tf.run() 9 | 10 | sub setup() 11 | if not isEmpty(allToExists) then exit sub 12 | allToExists = true 13 | if (new Email).allTo = "" then 14 | tf.info("Email.allTo must be set for the email tests. Thus email sending was not fully tested. set AJAXED_EMAIL_ALLTO in your config to fully test email sending.") 15 | allToExists = false 16 | end if 17 | end sub 18 | 19 | 'tries to send an email with each installed component 20 | 'if no components are installed then nothing will be tested ;) 21 | sub test_1() 22 | components = (new Email).supportedComponents 23 | sentEmails = 0 24 | for each c in components 25 | AJAXED_EMAIL_COMPONENTS = array(c) 26 | set e = new Email 27 | if e.component <> "" then 28 | e.subject = "Test" 29 | e.body = "test" 30 | e.sendersEmail = "tester@ajaxed.com" 31 | e.addRecipient "to", "some@someemail.com", "michal" 32 | e.addRecipient "cc", "someCC@someemail.com", "CCer" 33 | e.addRecipient "bcc", "someBCC@someemail.com", "BCCer" 34 | e.body = "test email with " & e.component 35 | e.addAttachment server.mappath("test_attachment.txt"), false, empty 36 | if not allToExists then e.dispatch = false 37 | sent = e.send() 38 | tf.assert sent, "email could not be sent with detected component '" & e.component & "' " & "(" & e.errorMsg & ")" 39 | if sent then sentEmails = sentEmails + 1 40 | end if 41 | next 42 | if sentEmails > 0 then 43 | if (new Email).dispatch then 44 | tf.info(sentEmails & " test emails should be in the inbox of '" & (new Email).allTo & "'") 45 | else 46 | tf.info(sentEmails & " test emails have been sent but not dispatched because dispatching is turned off. Turn dispatching on if full test of sending emails is required.'") 47 | end if 48 | end if 49 | end sub 50 | 51 | 'tries to send an emil with a component which does not exist 52 | sub test_2() 53 | AJAXED_EMAIL_COMPONENTS = array("no component") 54 | set e = new Email 55 | e.subject = "Test" 56 | e.sendersEmail = "test@tester.com" 57 | e.sendersName = "Test Tester" 58 | e.addRecipient "TO", "john@recipient.com", "John Recipient" 59 | e.body = "test" 60 | tf.assertNot e.send(), "it must be possible to send an email even if no component has been found" 61 | tf.assert e.errorMsg <> "", "after sending without component there must be an errormessage" 62 | end sub 63 | %> -------------------------------------------------------------------------------- /ajaxed/class_localization/localization.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: Localization 5 | '' @CREATOR: michal 6 | '' @CREATEDON: 2008-07-16 11:18 7 | '' @CDESCRIPTION: Contains all stuff which has to do with Localization. 8 | '' "Localization is the configuration that allows a program to be adaptable to local national-language features." 9 | '' Also stuff about the client can be found in this class e.g. clients IP address (often needed to localize the user) 10 | '' @REQUIRES: - 11 | '' @VERSION: 0.1 12 | '' @STATICNAME: local 13 | 14 | '************************************************************************************************************** 15 | class Localization 16 | 17 | public property get comma ''[char] Gets the char which represents the comma when using floating numbers. Returns either "," or "." 18 | comma = left(right(formatNumber(1.1, 1), 2), 1) 19 | end property 20 | 21 | public property get IP ''[string] gets the clients IP address (can also be the clients ISP IP). 22 | IP = request.serverVariables("REMOTE_ADDR") 23 | end property 24 | 25 | '************************************************************************************************************** 26 | '' @SDESCRIPTION: Checks if the client supports cookies 27 | '' @DESCRIPTION: Basically a cookies is written to the client and tried to retrieve it. If cannot retrieve it then no cookies support is assumed. 28 | '' @RETURN: [bool] TRUE if supports cookies otherwise FALSE 29 | '************************************************************************************************************** 30 | function supportsCookies() 31 | response.cookies("ajaxedTestCookie") = "1" 32 | response.cookies("ajaxedTestCookie").expires = dateAdd("yyyy", 1, now()) 33 | supportsCookies = request.cookies("ajaxedTestCookie") = "1" 34 | end function 35 | 36 | '************************************************************************************************************** 37 | '' @SDESCRIPTION: Locates the country of a given clients IP address. 38 | '' @DESCRIPTION: Currently Information is gathered from the free service at http://www.hostip.info and the clients IP is 39 | '' taken from the serverVariables. Note: As the location is the ISPs location its not sure that the 40 | '' client is located in the same location. 41 | '' - The location is cached within the users session. Therefore only the first call will access the service (unless its a failure). 42 | '' - Hint: For debuging you can check the logfile to see all the communication details with the service. 43 | '' Example of a correct call: 44 | '' 45 | '' <% 46 | '' countryCode = local.locateClient(2, empty) 47 | '' if isEmpty(countryCode) then str.writeEnd("Service unavailable") 48 | '' if countryCode = "XX" then str.writeEnd("Location unknown") 49 | '' 'if location was found then the country is available for sure 50 | '' str.writef("You are located in '{0}', arent you?", countryCode) 51 | '' % > 52 | '' 53 | '' @PARAM: timeout [int]: Timeout for the request in seconds. 0 mean as long as possible (not recommended!) 54 | '' @PARAM: clientIP [string]: The IP you want to check. Provide EMPTY to check the clients IP (Localization.IP). Only if EMPTY is given then the query will be temporary cached in the session. 55 | '' @RETURN: [string] 56 | '' - Returns the 2 letters upper-cased country code (if could determine) as given in ISO 3166-1. 57 | '' - Returns XX if the location is unknown (service is available but could not determine location). Also if the IP is private. 58 | '' - Returns EMPTY on a failure (xml parsing errors & network errors e.g. timeout, service down, etc.) 59 | '************************************************************************************************************** 60 | public function locateClient(timeout, clientIP) 61 | locateClient = empty 62 | 'if its cached then take it and run... 63 | if isEmpty(clientIP) and session("ajaxed_locateClient") <> "" then 64 | locateClient = session("ajaxed_locateClient") 65 | lib.logger.debug "Got cached Localization.locateClient() from session." 66 | exit function 67 | end if 68 | set ixmlhttp = lib.requestURL("get", "http://api.hostip.info/", array("ip", lib.iif(isEmpty(clientIP), IP, clientIP)), empty) 69 | if ixmlhttp is nothing then exit function 70 | if ixmlhttp.status <> 200 then 71 | lib.logger.debug "Localization.geocodeClient() response was NOT successful: " & ixmlhttp.status 72 | exit function 73 | end if 74 | set xml = server.createObject("microsoft.xmldom") 75 | xml.loadXML(ixmlhttp.responseText) 76 | if xml.parseError.errorCode <> 0 then 77 | lib.logger.debug "Localization.geocodeClient() could not parse XML: " & xml.parseError.reason 78 | exit function 79 | end if 80 | locateClient = "XX" 81 | 'now lets parse the XML. its specific to the provider (currently api.hostip.info) 82 | set n = xml.getElementsByTagName("countryAbbrev") 83 | if n.length > 0 then 84 | locateClient = uCase(n(0).text) 85 | 'if the country abbreviation is XX then its an unknown address 86 | if len(locateClient) <> 2 then locateClient = "XX" 87 | end if 88 | set xml = nothing 89 | 'cache the value if its for the clients IP 90 | if isEmpty(clientIP) then session("ajaxed_locateClient") = locateClient 91 | end function 92 | 93 | end class 94 | %> -------------------------------------------------------------------------------- /ajaxed/class_localization/test_localization.asp: -------------------------------------------------------------------------------- 1 | 2 | <% 3 | set tf = new TestFixture 4 | tf.run() 5 | 6 | sub test_1() 7 | tf.assertHas array(",", "."), local.comma, "local.comma does not work" 8 | old = setLocale("en-gb") 9 | tf.assertEqual ".", local.comma, "local.comma does not work" 10 | setLocale("de") 11 | tf.assertEqual ",", local.comma, "local.comma does not work" 12 | setLocale(old) 13 | end sub 14 | 15 | sub test_2() 16 | 'this IP is located in austria 17 | anIP = "213.129.245.250" 18 | 19 | code = local.locateClient(0, anIP) 20 | if isempty(code) then 21 | tf.info "Could not test Localization.geocodeClient() because it seems there is no network connection." 22 | exit sub 23 | end if 24 | if code = "XX" then 25 | tf.info "Localization.geocodeClient() does not contain information about your IP. " & anIP 26 | else 27 | tf.assert code <> "", "Country not identified" 28 | end if 29 | 30 | 'private IP 31 | tf.assertEqual "XX", local.locateClient(0, "127.0.0.1"), "Private addresses should be marked as unknown" 32 | end sub 33 | %> -------------------------------------------------------------------------------- /ajaxed/class_logger/test_logger.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | set tf = new TestFixture 4 | tf.debug = true 5 | tf.run() 6 | 7 | sub test_1() 8 | lib.logger.clearLogs() 9 | lib.logger.logLevel = 1 10 | tf.assertNot lib.fso.fileExists(server.mappath(lib.logger.logFile)), "log file should be gone after clearLogs()" 11 | tf.assert not lib.logger is nothing, "lib.logger not available" 12 | 13 | lib.logger.log 1, "some log msg", 31 14 | tf.assertInFile lib.logger.logFile, "[31msome log msg", "logger.log() didnt work properly (should contain ascii styles)" 15 | 16 | lib.logger.debug("testing the debug logging") 17 | tf.assertInFile lib.logger.logFile, "testing the debug logging", "logger.debug() didnt work" 18 | 19 | lib.logger.warn("some warning") 20 | tf.assertInFile lib.logger.logFile, "some warning", "logger.warn() didnt work" 21 | 22 | lib.logger.info("some info") 23 | tf.assertInFile lib.logger.logFile, "some info", "logger.info() didnt work" 24 | 25 | lib.logger.error("some error") 26 | tf.assertInFile lib.logger.logFile, "some error", "logger.error() didnt work" 27 | 28 | 'should not throw errors 29 | lib.logger.log 1, null, 31 30 | lib.logger.log 1, empty, 31 31 | end sub 32 | 33 | sub test_2() 34 | lib.logger.logLevel = 0 35 | lib.logger.debug("notInIt1") 36 | lib.logger.warn("notInIt1") 37 | lib.logger.info("notInIt1") 38 | lib.logger.error("notInIt1") 39 | tf.assertNotInFile lib.logger.logFile, "notInIt1", "logile should not contain any logs if logLevel is 0 (disabled)" 40 | lib.logger.clearLogs() 41 | 42 | lib.logger.logLevel = 1 43 | lib.logger.debug("debugMSG") 44 | lib.logger.warn("warnMSG") 45 | lib.logger.info("infoMSG") 46 | lib.logger.error("errorMSG") 47 | tf.assertInFile lib.logger.logFile, "debugMSG", "logile should contain 'debug' msg if level is set to debug (1)" 48 | tf.assertInFile lib.logger.logFile, "warnMSG", "logile should contain 'warn' msg if level is set to debug (1)" 49 | tf.assertInFile lib.logger.logFile, "infoMSG", "logile should contain 'info' msg if level is set to debug (1)" 50 | tf.assertInFile lib.logger.logFile, "errorMSG", "logile should contain 'error' msg if level is set to debug (1)" 51 | lib.logger.clearLogs() 52 | 53 | lib.logger.logLevel = 2 54 | lib.logger.debug("debugMSG") 55 | lib.logger.warn("warnMSG") 56 | lib.logger.info("infoMSG") 57 | lib.logger.error("errorMSG") 58 | tf.assertNotInFile lib.logger.logFile, "debugMSG", "logile should NOT contain 'debug' msg if level is set to info (2)" 59 | tf.assertInFile lib.logger.logFile, "warnMSG", "logile should contain 'warn' msg if level is set to info (2)" 60 | tf.assertInFile lib.logger.logFile, "infoMSG", "logile should contain 'info' msg if level is set to info (2)" 61 | tf.assertInFile lib.logger.logFile, "errorMSG", "logile should contain 'error' msg if level is set to info (2)" 62 | lib.logger.clearLogs() 63 | 64 | lib.logger.logLevel = 4 65 | lib.logger.debug("debugMSG") 66 | lib.logger.warn("warnMSG") 67 | lib.logger.info("infoMSG") 68 | lib.logger.error("errorMSG") 69 | tf.assertNotInFile lib.logger.logFile, "debugMSG", "logile should NOT contain 'debug' msg if level is set to warn (4)" 70 | tf.assertNotInFile lib.logger.logFile, "infoMSG", "logile should NOT contain 'info' msg if level is set to warn (4)" 71 | tf.assertInFile lib.logger.logFile, "warnMSG", "logile should contain 'warn' msg if level is set to warn (4)" 72 | tf.assertInFile lib.logger.logFile, "errorMSG", "logile should contain 'error' msg if level is set to warn (4)" 73 | lib.logger.clearLogs() 74 | 75 | lib.logger.logLevel = 8 76 | lib.logger.debug("debugMSG") 77 | lib.logger.warn("warnMSG") 78 | lib.logger.info("infoMSG") 79 | lib.logger.error("errorMSG") 80 | tf.assertNotInFile lib.logger.logFile, "debugMSG", "logile should NOT contain 'debug' msg if level is set to error (8)" 81 | tf.assertNotInFile lib.logger.logFile, "infoMSG", "logile should NOT contain 'info' msg if level is set to error (8)" 82 | tf.assertNotInFile lib.logger.logFile, "warnMSG", "logile should NOT contain 'warn' msg if level is set to error (8)" 83 | tf.assertInFile lib.logger.logFile, "errorMSG", "logile should contain 'error' msg if level is set to error (8)" 84 | lib.logger.clearLogs() 85 | end sub 86 | 87 | sub test_3() 88 | 'log utf8 chars 89 | lib.logger.logLevel = 1 90 | lib.logger.debug chrw(352) 91 | end sub 92 | %> -------------------------------------------------------------------------------- /ajaxed/class_stringBuilder/stringBuilder.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: StringBuilder 5 | '' @CREATOR: m 6 | '' @CREATEDON: 2008-05-07 15:14 7 | '' @CDESCRIPTION: Represents a string builder which handles string concatenation. If a supported stringbuilder 8 | '' COM component can be found it is used and hence the concatenation is much faster than common string 9 | '' concatening. 10 | '' - check supported components with the supportedComponents property. 11 | '' - you should use it whereever there is a loads of output to be rendered on your page. Its faster than normal concatening. 12 | '' - basically just intantiate it and use append() method for appending. In the end use toString() to output your string 13 | '' - if there is no component found then it would be faster to directly write the output to the response. This can be achieved using the write() method 14 | '' Best way to use the StringBuilder (always uses the fastest possible method): 15 | '' 16 | '' <% 17 | '' set output = new StringBuilder 18 | '' output("some text") 19 | '' output("some other text") 20 | '' % > 21 | '' <%= output.toString() % > 22 | '' 23 | '' @REQUIRES: - 24 | '' @VERSION: 0.1 25 | 26 | '************************************************************************************************************** 27 | class StringBuilder 28 | 29 | 'private members 30 | private p_component 31 | 32 | 'public members 33 | public component ''[string] holds the component which should be used. EMPTY = none (common concatination) 34 | 35 | public property get supportedComponents ''[array] gets the supported string builder COM components. the order represents the order which will be loaded first if available 36 | supportedComponents = array("system.io.stringwriter", "stringbuildervb.stringbuilder") 37 | end property 38 | 39 | '********************************************************************************************************** 40 | '* constructor 41 | '********************************************************************************************************** 42 | public sub class_initialize() 43 | component = lib.detectComponent(supportedComponents) 44 | if not isEmpty(component) then 45 | set p_component = server.createObject(component) 46 | if component = "stringbuildervb.stringbuilder" then p_component.init 40000, 7500 47 | end if 48 | end sub 49 | 50 | '********************************************************************************************************** 51 | '* desctructor 52 | '********************************************************************************************************** 53 | public sub class_terminate() 54 | set p_component = nothing 55 | end sub 56 | 57 | '********************************************************************************************************** 58 | '' @SDESCRIPTION: writes a string with the string builder. the difference to append is that it will 59 | '' output to the response if there is no component found 60 | '' @DESCRIPTION: - its recommended to use this instead of append() when rendering html markup. it wil allways use this fastest method. if stringbuilder available then using stringbuilder otherwise direct output to response. 61 | '' - note: be sure that on the place you use write() it can output directly to the response if needed 62 | '' @PARAM: val [string]: the string you want to write 63 | '********************************************************************************************************** 64 | public default sub write(val) 65 | if isEmpty(component) then 66 | str.write(val) 67 | else 68 | append(val) 69 | end if 70 | end sub 71 | 72 | '********************************************************************************************************** 73 | '' @SDESCRIPTION: appends a string to the builder 74 | '' @PARAM: val [string]: the string you want to append 75 | '********************************************************************************************************** 76 | public sub append(val) 77 | if isNull(val) then val = "" 78 | if isEmpty(component) then 79 | p_component = p_component & val 80 | elseif component = "system.io.stringwriter" then 81 | p_component.write_12(val) 82 | elseif component = "stringbuildervb.stringbuilder" then 83 | p_component.append(val) 84 | else 85 | lib.throwError("unknown stringbuilder component") 86 | end if 87 | end sub 88 | 89 | '********************************************************************************************************** 90 | '' @SDESCRIPTION: returns the concatenated string 91 | '' @RETURN: [string] concatenated string 92 | '********************************************************************************************************** 93 | public function toString() 94 | if isEmpty(component) then 95 | toString = p_component 96 | elseif component = "system.io.stringwriter" then 97 | toString = p_component.getStringBuilder().toString() 98 | elseif component = "stringbuildervb.stringbuilder" then 99 | toString = p_component.toString() 100 | else 101 | lib.throwError("unknown stringbuilder component") 102 | end if 103 | end function 104 | 105 | end class 106 | %> -------------------------------------------------------------------------------- /ajaxed/class_stringBuilder/test_stringBuilder.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | set tf = new TestFixture 4 | tf.run() 5 | 6 | sub test_1() 7 | set output = new StringBuilder 8 | for i = 1 to 10 9 | output.append("x") 10 | output.append("") 11 | output.append(empty) 12 | output.append(null) 13 | next 14 | tf.assertEqual "xxxxxxxxxx", output.toString(), "Stringbuilder does not work" 15 | end sub 16 | %> -------------------------------------------------------------------------------- /ajaxed/class_stringOperations/test_stringOperations.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | set tf = new TestFixture 4 | tf.debug = true 5 | tf.run() 6 | 7 | sub test_1() 8 | tf.assertEqual str.parse("202", 0), 202, "str.parse parses int" 9 | tf.assertEqual str.parse("229029899809809", 0), 0, "str.parse should not be able to parse a too big int" 10 | tf.assertEqual year(str.parse("1/1/2007", now())), 2007, "str.parse parsing a date" 11 | tf.assertEqual str.parse("True", false), true, "str.parse should parse booleans" 12 | tf.assertEqual str.parse(str.format("2022{0}22", local.comma), 0.0), 2022.22, "str.parse parsing floats" 13 | tf.assertEqual str.parse(null, 1), 1, "str.parse() must be able to accept NULLs as well." 14 | tf.assertEqual str.parse(empty, 0.2), 0.2, "str.parse() must be able to accept EMPTY as well." 15 | end sub 16 | 17 | sub test_2() 18 | emails = array( _ 19 | "checker@check.com", _ 20 | "che_cker@check.com", _ 21 | "jack.johnson@where-am-i.ac.at", _ 22 | "hottie10@hotmail.com" _ 23 | ) 24 | for each e in emails 25 | tf.assert str.isValidEmail(e), e & " should be a valid email" 26 | next 27 | emails = array( _ 28 | "checkercheck.com", _ 29 | "che_cker@checkcom", _ 30 | "jack.johnson@wh ere-am-i.ac.at", _ 31 | "hotti e10@hotmail.com", _ 32 | "@dump.com", _ 33 | "a@a.a" _ 34 | ) 35 | for each e in emails 36 | tf.assertNot str.isValidEmail(e), e & " should be an invalid email" 37 | next 38 | end sub 39 | 40 | sub test_3() 41 | tf.assertEqual "michal", str.rReplace("michXXalX", "x", "", true), "str.rReplace does not work" 42 | tf.assertEqual "michXXalX", str.rReplace("michXXalX", "x", "", false), "str.rReplace does not work" 43 | tf.assertEqual "mich.XX.alX", str.rReplace("michXXalX", "(xx)", ".$1.", true), "str.rReplace does not work" 44 | tf.assertEqual "michXXalX", str.rReplace("michXXalX", "nothing", "", true), "str.rReplace does not work" 45 | end sub 46 | 47 | sub test_4() 48 | tf.assertEqual "ein 1 zwei {1}", str.format("ein {0} zwei {1}", 1), "str.format does not work" 49 | tf.assertEqual "ein 1 zwei 2", str.format("ein {0} zwei {1}", array(1, 2)), "str.format does not work" 50 | tf.assertEqual "ein {0} zwei {1}", str.format("ein {0} zwei {1}", array()), "str.format does not work" 51 | tf.assertEqual "ein 1 zwei 2, 1", str.format("ein {0} zwei {1}, {0}", array(1, 2)), "str.format does not work" 52 | tf.assertEqual "{1},{0}", str.format("{0},{1}", array("{1}", "{0}")), "str.format should also allow placeholder as replacement values" 53 | end sub 54 | 55 | sub test_5() 56 | tf.assertEqual "Created on", str.humanize("created_ON"), "str.humanize does not work" 57 | tf.assertEqual "User", str.humanize("user_id"), "str.humanize does not work" 58 | tf.assertEqual "User", str.humanize("id_user"), "str.humanize does not work" 59 | tf.assertEqual "Main category", str.humanize("fk_main_category"), "str.humanize does not work" 60 | tf.assertEqual "Main category", str.humanize("main_category_fk"), "str.humanize does not work" 61 | tf.assertEqual "First name", str.humanize(" FIRST_NAME "), "str.humanize does not work" 62 | tf.assertEqual "News", str.humanize("id___news_fk"), "str.humanize does not work" 63 | tf.assertEqual "", str.humanize(empty), "str.humanize does not work" 64 | tf.assertEqual "", str.humanize(""), "str.humanize does not work" 65 | tf.assertEqual "A", str.humanize("a"), "str.humanize does not work" 66 | end sub 67 | 68 | sub test_6() 69 | tf.assert str.isAlphabetic("a"), "isAlphabetic() does not work" 70 | tf.assert str.isAlphabetic("A"), "isAlphabetic() does not work" 71 | tf.assert str.isAlphabetic("x"), "isAlphabetic() does not work" 72 | tf.assertNot str.isAlphabetic("_"), "isAlphabetic() does not work" 73 | tf.assertNot str.isAlphabetic(empty), "isAlphabetic() does not work" 74 | tf.assertNot str.isAlphabetic(""), "isAlphabetic() does not work" 75 | end sub 76 | 'TODO: add more tests here for all the string functions 77 | %> 78 | -------------------------------------------------------------------------------- /ajaxed/class_testFixture/test_file.txt: -------------------------------------------------------------------------------- 1 | this is a test file for the test_testFixture.asp -------------------------------------------------------------------------------- /ajaxed/class_testFixture/test_testFixture.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | set tf = new TestFixture 4 | tf.debug = true 5 | tf.run() 6 | 7 | sub test_1() 8 | tf.assertEqual "x", "x", "assertEqual" 9 | tf.assertEqual 2, 2, "assertEqual" 10 | tf.assertEqual 2, 2.0, "assertEqual" 11 | tf.assertEqual empty, empty, "assertEqual" 12 | tf.assertEqual array(1), array(1), "assertEqual" 13 | tf.assertEqual array(), array(), "assertEqual" 14 | tf.assertEqual array(2, 3, "four"), array(2, 3, "four"), "assertEqual" 15 | tf.assertEqual dateserial(year(date()), month(date()), day(date())), date(), "assertEqual" 16 | end sub 17 | 18 | sub test_2() 19 | tf.assertNotEqual "x", "y", "assertNotEqual" 20 | tf.assertNotEqual 2, 1, "assertNotEqual" 21 | tf.assertNotEqual 2, "2", "assertNotEqual" 22 | tf.assertNotEqual dateadd("d", 1, date()), date(), "assertNotEqual" 23 | tf.assertNotEqual array(), array(1), "assertNotEqual" 24 | tf.assertNotEqual array("a", "c"), array("a", "b"), "assertNotEqual" 25 | end sub 26 | 27 | sub test_3() 28 | tf.assertInstanceOf "string", "as", "assertInstanceOf" 29 | tf.assertInstanceOf "testFixture", new TestFixture, "assertInstanceOf" 30 | end sub 31 | 32 | sub test_4() 33 | tf.assertNothing nothing, "assertNothing" 34 | end sub 35 | 36 | sub test_5() 37 | tf.assertInDelta 1, 2, 1, "assertInDelta" 38 | tf.assertInDelta 0.5, 0.3, 0.2, "assertInDelta" 39 | tf.assertInDelta 200, 250, 50, "assertInDelta" 40 | end sub 41 | 42 | sub test_6() 43 | tf.assertMatch "rub. on ....s", "ruby on rails", "assertMatch" 44 | end sub 45 | 46 | sub test_7() 47 | tf.assert 1 = 1, "assert" 48 | end sub 49 | 50 | sub test_8() 51 | tf.assertHas array(1, 2, 3), 1, "assertHas" 52 | tf.assertHas array("some", "ads", "x"), "ads", "assertHas" 53 | tf.assertHas array(empty, null, 1), 1, "assertHas" 54 | tf.assertHasNot "x", "1", "assertHasNot" 55 | tf.assertHasNot array(1, 2, 3, 4), 0, "assertHasNot" 56 | end sub 57 | 58 | sub test_9() 59 | tf.assertInFile "test_file.txt", "test_testFixture.asp", "'test_testFixture.asp' should be in the test_file.txt" 60 | tf.assertNotInFile "test_file.txt.no", "test_testFixture.asp", "'test_file.txt.no' does not exists and so it should not contain any matches" 61 | tf.assertNotInFile "test_file.txt", "jack johnson", "test_file.txt should not contain 'jack johnson'" 62 | end sub 63 | 64 | sub test_10() 65 | testfile = "/ajaxed/class_testFixture/testfile.asp" 66 | tf.assertResponse testfile, empty, "some test file", "assertResponse() not working" 67 | tf.assertResponse testfile, array("id", 10), "id=10", "assertResponse() with GET params not working" 68 | tf.assertResponse array("get", testfile), array("id", 10), "id=10", "assertResponse() with GET params not working" 69 | tf.assertResponse array("post", testfile), array("x", 12), "x: 12", "assertResponse() with POST params not working" 70 | end sub 71 | %> 72 | -------------------------------------------------------------------------------- /ajaxed/class_testFixture/testfile.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | some test file for testing 6 | 7 | 8 | the content of the testfile
9 | <%= request.queryString %>
10 | <% for each f in request.form %> 11 | <%= f %>: <%= request.form(f) %>
12 | <% next %> 13 | 14 | -------------------------------------------------------------------------------- /ajaxed/class_textTemplate/class_TextTemplateBlock.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | 4 | '' @CLASSTITLE: TextTemplateBlock 5 | '' @CREATOR: Michal Gabrukiewicz 6 | '' @CREATEDON: 2006-10-28 14:36 7 | '' @CDESCRIPTION: Represents a block which is used within a TextTemplate. 8 | '' Blocks are defined with <<< BLOCK NAME >>> ... <<< BLOCKEND NAME >>>. Placeholders may be defined between the 9 | '' begining and the ending of the block. Example of a block 10 | '' 11 | '' <<< BLOCK DETAILS >>> 12 | '' Name: <<< NAME >>> 13 | '' <<< BLOCKEND DETAILS >>> 14 | '' 15 | '' @REQUIRES: - 16 | '' @FRIENDOF: TextTemplate 17 | '' @VERSION: 0.1 18 | 19 | '************************************************************************************************************** 20 | class TextTemplateBlock 21 | 22 | 'public members 23 | public items ''[dictionary] Items of the block. key = autoID, value = ARRAY with vars. 24 | 25 | '********************************************************************************************************** 26 | '* constructor 27 | '********************************************************************************************************** 28 | public sub class_initialize() 29 | set items = ["D"](empty) 30 | end sub 31 | 32 | '********************************************************************************************************** 33 | '' @SDESCRIPTION: Adds an item to the block. 34 | '' @DESCRIPTION: The number of items will result in the same number of copied blocks. 35 | '' @PARAM: vars [array]: A paired ARRAY. so 1st value is the name of the 1st var and 2nd value is 36 | '' is the value of the 1st var, etc. therfore number of values must be even! 37 | '' Example: <% vars = array(var1, value1, var2, value2, ...) % > 38 | '********************************************************************************************************** 39 | public sub addItem(vars) 40 | if not isArray(vars) then lib.throwError("TextTemplateBlock.addItem() requires an array.") 41 | if (uBound(vars) + 1) mod 2 <> 0 then 42 | lib.throwError("TextTemplateBlock.addItem() vars must be even when using addItem(). Example: (var1, value1, var2, value2, ...)") 43 | end if 44 | items.add lib.getUniqueID(), vars 45 | end sub 46 | 47 | '*********************************************************************************************************** 48 | '' @SDESCRIPTION: Adds all rows of a given recordset to the block. 49 | '' @DESCRIPTION: - The recordset is traversed from its current position. 50 | '' @PARAM: dataRS [recordset]: The name of the placeHolders within the block match the recordsets field names. 51 | '*********************************************************************************************************** 52 | public sub addRS(dataRS) 53 | if dataRS.eof then exit sub 54 | while not dataRS.eof 55 | set dc = (new DataContainer)(array()) 56 | for each field in dataRS.fields 57 | dc.add(field.name).add(dataRS.fields(field.name)) 58 | next 59 | addItem(dc.data) 60 | dataRS.movenext() 61 | wend 62 | end sub 63 | 64 | end class 65 | %> -------------------------------------------------------------------------------- /ajaxed/class_textTemplate/testTemplate.template: -------------------------------------------------------------------------------- 1 | Email Subject <<< NAME >>> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | <<< BLOCK WEEKDAYS >>> 29 | 30 | 31 | 32 | <<< ENDBLOCK WEEKDAYS >>> 33 | 34 | <<< BLOCK CLEANEDOUT >>> 35 | 36 | 37 | 38 | 39 | 40 | <<< ENDBLOCK CLEANEDOUT >>> 41 | 42 |
Text Parser:<<< VERSION >>>
Date modified:<<< MoDIFIED | not used value >>>
Modified by:<<< NAME >>>
Modified by: <<< NAME >>>
Not parsed:<<>>
Approver:<<< APPROVER | John Doe >>>
<<< WEEKDAY >>>: <<< VALUE >>>
<<< WEEKDAY >>>:<<< VALUE >>>
43 | 44 | <<< BLOCK WEEKDAYS >>> 45 |

<<< WEEKDAY | none >>>

46 | <<< WEEKDAY >>> (<<< VALUE | not used value >>>)  47 | <<< ENDBLOCK WEEKDAYS >>> 48 | -------------------------------------------------------------------------------- /ajaxed/class_textTemplate/test_textTemplate.asp: -------------------------------------------------------------------------------- 1 | <% on error resume next %> 2 | 3 | 4 | <% 5 | set tf = new TestFixture 6 | tf.run() 7 | 8 | sub test_1() 9 | 10 | set t = new TextTemplate 11 | with t 12 | .fileName = "testTemplate.template" 13 | .addVariable "version", "0.2" 14 | .addVariable "MODIFIED", "06.09.2006" 15 | .addVariable "NAME", "Jack Johnson" 16 | .addVariable "notparsed", "this should not be added, because the placeholder is defined wrong in the template" 17 | set block = new TextTemplateBlock 18 | block.addItem(array("WEEKDAY", "Monday", "VALUE", vbMonday)) 19 | block.addItem(array("WEEKDAY", "Tuesday", "VALUE", vbTuesday)) 20 | block.addItem(array("WEEKDAY", "Friday", "VALUE", vbFriday)) 21 | block.addItem(array("WEEKDAY", empty, "VALUE", vbsaturday)) 22 | .addVariable "WEEKDAYS", block 23 | end with 24 | 25 | 'test first line 26 | tf.assertEqual t.getFirstLine(), "Email Subject Jack Johnson", "parsing first line" 27 | 28 | 'test common placeholders 29 | parsedTemplate = t.getAllButFirstLine() 30 | tf.assertMatch "06.09.2006", parsedTemplate, "template.getAllButFirstLine() not working" 31 | tf.assertMatch "Jack Johnson", parsedTemplate, "NAME placeholder not parsed correctly" 32 | tf.assertMatch "Modified by: Jack Johnson", parsedTemplate, "NAME placeholder not parsed correctly (multiple times)" 33 | tf.assertMatch "0.2", parsedTemplate, "VERSION placeholder not parsed correctly" 34 | tf.assertMatch "<<>>", parsedTemplate, "NOTPARSED placeholder was parsed (although invalid)" 35 | 36 | 'test default placeholder values 37 | tf.assertMatch "John Doe", parsedTemplate, "default walue not set. we did not added an APPROVER variable therefore default value should be passed through" 38 | tf.assert instr(parsedTemplate, "not used value") = 0, "default value should be cleaned out if a variable is available" 39 | tf.assertMatch "

none

", parsedTemplate, "WEEKDAYS saturday does not contain a value and therefore default should be used" 40 | 41 | 'test first block 42 | tf.assertMatch "Monday: " & vbMonday & "", parsedTemplate, "first WEEKDAYS (monday) block not parsed correctly" 43 | tf.assertMatch "Tuesday: " & vbTuesday & "", parsedTemplate, "first WEEKDAYS (tuesday) not parsed correctly" 44 | tf.assertMatch "Friday: " & vbFriday & "", parsedTemplate, "first WEEKDAYS (friday) block not parsed correctly" 45 | 46 | 'test second block (has same name) 47 | tf.assertMatch "

Monday

", parsedTemplate, "WEEKDAYS (monday) block not parsed correctly (placeholder multiple times should work)" 48 | tf.assertMatch "Monday \(" & vbMonday & "\)", parsedTemplate, "WEEKDAYS (monday) block not parsed correctly" 49 | 50 | tf.assertMatch "

Tuesday

", parsedTemplate, "WEEKDAYS (tuesday) block not parsed correctly (placeholder multiple times should work)" 51 | tf.assertMatch "Tuesday \(" & vbTuesday & "\)", parsedTemplate, "WEEKDAYS (tuesday) block not parsed correctly" 52 | 53 | tf.assertMatch "

Friday

", parsedTemplate, "WEEKDAYS (friday) block not parsed correctly (placeholder multiple times should work)" 54 | tf.assertMatch "Friday \(" & vbFriday & "\)", parsedTemplate, "WEEKDAYS (friday) block not parsed correctly" 55 | 56 | 'unused blocks 57 | tf.assert instr(parsedTemplate, "CLEANEDOUT") = 0, "unused blocks should be cleaned out" 58 | end sub 59 | 60 | 'test adding a recordset 61 | sub test_2() 62 | set t = new TextTemplate 63 | with t 64 | .fileName = "testTemplate.template" 65 | set block = new TextTemplateBlock 66 | block.addRS(["R"](array( _ 67 | array("weekday", "value"), _ 68 | array("Monday", "first"), _ 69 | array("Sunday", "last") _ 70 | ))) 71 | .addVariable "WEEKDAYS", block 72 | end with 73 | 74 | parsedTemplate = t.getAllButFirstLine() 75 | tf.assertMatch "Monday: first", parsedTemplate, "block not parsed with recordset" 76 | tf.assertMatch "Sunday: last", parsedTemplate, "block not parsed with recordset 2" 77 | end sub 78 | 79 | 'test invalid filename and empty content 80 | sub test_3() 81 | set t = new TextTemplate 82 | t.fileName = "invalid.template" 83 | 84 | 'invalid filename and empty content 85 | on error resume next 86 | t.returnString() 87 | 88 | if Err.number = 0 then 89 | tf.fail("TextTemplate should throw an exception when filename is invalid and content is null") 90 | end if 91 | on error goto 0 92 | 93 | t.content = "Now, content have some text" 94 | tf.assertMatch "Now, content have some text", t.returnString(), "Template content not parsed correctly" 95 | end sub 96 | 97 | 'test default parameter value <<< TAG | default value >>> 98 | sub test_4() 99 | set t = new TextTemplate 100 | t.content = "Test <<< TEST1 | defaultvalue >>>" 101 | 102 | tf.assertMatch "Test defaultvalue", t.returnString(), "Template content not parsed correctly" 103 | t.add "TEST1", "" 104 | tf.assertMatch "Test ", t.returnString(), "Template content not parsed correctly" 105 | 106 | t.add "TEST1", "value" 107 | tf.assertMatch "Test value", t.returnString(), "Template content not parsed correctly" 108 | 109 | t.content = "<<< TAG1 | defaultvalue1 >>> and <<< TAG2 | defaultvalue2 >>>" 110 | 111 | tf.assertMatch "defaultvalue1 and defaultvalue2", t.returnString(), "Template content not parsed correctly" 112 | 113 | t.add "TAG1", "value1" 114 | tf.assertMatch "value1 and defaultvalue2", t.returnString(), "Template content not parsed correctly" 115 | t.add "TAG2", "value2" 116 | tf.assertMatch "value1 and value2", t.returnString(), "Template content not parsed correctly" 117 | end sub 118 | 119 | ' Regression test to issue #15 120 | ' Replacing a block, we get an exception! It's wrong 121 | sub test_5() 122 | set t = new TextTemplate 123 | set b = new TextTemplateBlock 124 | b.additem Array("item", "first") 125 | t.add "MYBLOCK", b 126 | b.additem Array("item", "another") 127 | t.add "MYBLOCK", b 128 | t.add "MYBLOCK", "value" 129 | end sub 130 | %> 131 | 132 | -------------------------------------------------------------------------------- /ajaxed/class_uploader/uploader.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '*************************************** 3 | ' File: Upload.asp 4 | ' Author: Jacob "Beezle" Gilley 5 | ' Email: avis7@airmail.net 6 | ' Date: 12/07/2000 7 | ' Updated: 12/20/2002 8 | ' Modified by: Will Bickford 9 | ' Email: wbic16@hotmail.com 10 | ' Comments: The code for the Upload, CByteString, 11 | ' CWideString subroutines was originally 12 | ' written by Philippe Collignon...or so 13 | ' he claims. This script is provided 14 | ' "AS-IS" without support of any kind. 15 | ' Taken from: http://www.asp101.com/articles/jacob/scriptupload.asp 16 | '**************************************** 17 | 18 | Class FileUploader 19 | Public Files 20 | Private mcolFormElem 21 | 22 | Public Property Get Form(sIndex) 23 | Form = "" 24 | If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex)) 25 | End Property 26 | 27 | Public Default Sub Upload() 28 | Dim biData, sInputName 29 | Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos 30 | Dim nPosFile, nPosBound 31 | 32 | biData = Request.BinaryRead(Request.TotalBytes) 33 | nPosBegin = 1 34 | nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13))) 35 | 36 | If (nPosEnd-nPosBegin) <= 0 Then Exit Sub 37 | 38 | vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin) 39 | nDataBoundPos = InstrB(1, biData, vDataBounds) 40 | 41 | Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--")) 42 | 43 | nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition")) 44 | nPos = InstrB(nPos, biData, CByteString("name=")) 45 | nPosBegin = nPos + 6 46 | nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34))) 47 | sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) 48 | nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename=")) 49 | nPosBound = InstrB(nPosEnd, biData, vDataBounds) 50 | 51 | If nPosFile <> 0 And nPosFile < nPosBound Then 52 | Dim oUploadFile, sFileName 53 | Set oUploadFile = New UploadedFile 54 | 55 | nPosBegin = nPosFile + 10 56 | nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34))) 57 | sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) 58 | oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\")) 59 | 60 | nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:")) 61 | nPosBegin = nPos + 14 62 | nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13))) 63 | oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) 64 | 65 | nPosBegin = nPosEnd+4 66 | nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2 67 | oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin) 68 | 69 | If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile 70 | Else 71 | nPos = InstrB(nPos, biData, CByteString(Chr(13))) 72 | nPosBegin = nPos + 4 73 | nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2 74 | If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) 75 | End If 76 | nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds) 77 | Loop 78 | End Sub 79 | 80 | Private Sub Class_Initialize() 81 | Set Files = Server.CreateObject("Scripting.Dictionary") 82 | Set mcolFormElem = Server.CreateObject("Scripting.Dictionary") 83 | End Sub 84 | 85 | Private Sub Class_Terminate() 86 | If IsObject(Files) Then 87 | Files.RemoveAll() 88 | Set Files = Nothing 89 | End If 90 | 91 | If IsObject(mcolFormElem) Then 92 | mcolFormElem.RemoveAll() 93 | Set mcolFormElem = Nothing 94 | End If 95 | End Sub 96 | 97 | 'String to byte string conversion 98 | Private Function CByteString(sString) 99 | Dim nIndex 100 | For nIndex = 1 to Len(sString) 101 | CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1))) 102 | Next 103 | End Function 104 | 105 | 'Byte string to string conversion 106 | Private Function CWideString(bsString) 107 | Dim nIndex 108 | CWideString ="" 109 | For nIndex = 1 to LenB(bsString) 110 | CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1))) 111 | Next 112 | End Function 113 | End Class 114 | 115 | Class UploadedFile 116 | Public ContentType 117 | Public FileName 118 | Public FileData 119 | 120 | Public Property Get FileSize() 121 | FileSize = LenB(FileData) 122 | End Property 123 | 124 | Public Sub SaveToDisk(sPath,sCFN) 125 | Dim oFS, oFile 126 | Dim nIndex 127 | 128 | If sPath = "" Or sCFN = "" Then Exit Sub 129 | 'If FileData = "" Or FileName = "" Then Exit Sub 130 | If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\" 131 | 132 | Set oFS = Server.CreateObject("Scripting.FileSystemObject") 133 | 134 | If Not oFS.FolderExists(sPath) Then Exit Sub 135 | 136 | Set oFile = oFS.CreateTextFile((sPath & sCFN), True, False) 137 | oFile.Write BufferContent(FileData) 138 | oFile.Close 139 | End Sub 140 | 141 | Public Sub SaveToDatabase(ByRef oField) 142 | If LenB(FileData) = 0 Then Exit Sub 143 | 144 | If IsObject(oField) Then 145 | oField.AppendChunk FileData 146 | End If 147 | End Sub 148 | 149 | '*********************************************************** 150 | 'Code for more efficient buffering 151 | ' Original Code written by: Robbert Nix 152 | ' Adapted and Modified by: Will Bickford 153 | ' Date: 12/20/2002 154 | ' Email: wbic16@hotmail.com 155 | ' From: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=7110 156 | 157 | Private Function BufferContent(data) 158 | Dim strContent(64) 159 | Dim i 160 | 161 | ClearString strContent 162 | 163 | For i = 1 To LenB(data) 164 | AddString strContent,Chr(AscB(MidB(data,i,1))) 165 | Next 166 | 167 | BufferContent = fnReadString(strContent) 168 | End Function 169 | 170 | Private Sub ClearString(part) 171 | Dim index 172 | 173 | For index = 0 to 64 174 | part(index)="" 175 | Next 176 | End Sub 177 | 178 | Private Sub AddString(part,newString) 179 | Dim tmp 180 | Dim index 181 | 182 | part(0) = part(0) & newString 183 | 184 | If Len(part(0)) > 64 Then 185 | index=0 186 | tmp="" 187 | 188 | Do 189 | tmp=part(index) & tmp 190 | part(index) = "" 191 | index = index + 1 192 | Loop until part(index) = "" 193 | 194 | part(index) = tmp 195 | End If 196 | End Sub 197 | 198 | Private Function fnReadString(part) 199 | Dim tmp 200 | Dim index 201 | 202 | tmp = "" 203 | 204 | For index = 0 to 64 205 | If part(index) <> "" Then 206 | tmp = part(index) & tmp 207 | End If 208 | Next 209 | 210 | FnReadString = tmp 211 | End Function 212 | End Class 213 | %> -------------------------------------------------------------------------------- /ajaxed/class_validator/test_validator.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set tf = new TestFixture 5 | tf.debug = True 6 | tf.run() 7 | 8 | sub test_1() 9 | set v = new Validator 10 | tf.assertEqual empty, v.getErrorSummary("
", "
", "
  • ", "
  • "), "validator.getErrorSummary() must return no summary if no errors" 11 | tf.assert v, "New validator must be valid" 12 | tf.assert v.add("firstname", "firstname wrong"), "validator.add() must return true on add()" 13 | tf.assertNot v.valid, "after adding an invalid field the validator must be invalid" 14 | tf.assertNot v.add("firstname", "somethign"), "validator.add() must return false if a field already exists with this name" 15 | tf.assert v.add("lastname", "lastname wrong"), "validator.add() must return true on add" 16 | tf.assert v.isInvalid("FIRSTname"), "validator.isInvalid() must return true if field is invalid" 17 | tf.assert v.isInvalid(array("some", "lastname")), "validator.isInvalid() must return true if at least one field is invalid" 18 | tf.assertNot v.isInvalid(array("some", "other")), "validator.isInvalid() must return false if no field is invalid" 19 | tf.assertEqual "lastname wrong", v.getDescription("lastname"), "Validator.getDescritpion() does not work" 20 | sum = v.getErrorSummary("
      ", "
    ", "
  • ", "
  • ") 21 | tf.assertMatch "
  • lastname wrong
  • ", sum, "validator.getErrorSummary() not working" 22 | tf.assertMatch "
  • firstname wrong
  • ", sum, "validator.getErrorSummary() not working" 23 | tf.assertMatch "^
      .*
    $", sum, "validator.getErrorSummary() must contain overall prefix and postfix" 24 | tf.assert v.reflect()("data").count = 2, "validator.reflect() must return 2 data items" 25 | tf.assertNot v.reflect()("valid"), "validator.reflect() must return an invalid validator" 26 | end sub 27 | %> 28 | -------------------------------------------------------------------------------- /ajaxed/config.asp: -------------------------------------------------------------------------------- 1 | <% 2 | '************************************************************************************************************** 3 | '* Michal Gabrukiewicz Copyright (C) 2007 4 | '* For license refer to the license.txt 5 | '************************************************************************************************************** 6 | 7 | 'All configurations are listed here. uncomment the line if you want to use a configuration variable 8 | 'In 90% cases you don't need to change anything. 9 | '(most of those settings are properties of classes and are initialized when the class is instantiated, 10 | 'therefore this means that you can change it after initialization also.) 11 | 12 | '************************************************************************************************************** 13 | 14 | '*** The vitual location to the ajaxed folder. must end AND start with an SLASH! (/) 15 | 'const AJAXED_LOCATION = "/ajaxed/" 16 | 17 | '*** The text which appears when a callback is being performed and the user has to wait 18 | 'const AJAXED_LOADINGTEXT = "loading..." 19 | 20 | '*** should the prototype JavaScript library be automatically loaded on every page? 21 | 'const AJAXED_LOADPROTOTYPEJS = true 22 | 23 | '*** the caption for the errors used with error() method 24 | 'const AJAXED_ERRORCAPTION = "Erroro: " 25 | 26 | '*** sets the response.buffer for each page. 27 | 'const AJAXED_BUFFERING = true 28 | 29 | '*** ID of the form which should be used by default when no form is specified 30 | 'const AJAXED_FORMID = "frm" 31 | 32 | '*** Should the database connection be established automatically on each page. 33 | 'const AJAXED_DBCONNECTION = true 34 | 35 | '*** If you want to use a database with the ajaxed Library then configure a proper connectionstring 36 | '*** to your database. Some are suggested below. uncomment if applicable 37 | 'mySQL 38 | 'const AJAXED_CONNSTRING = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=YOUR_DB;User=YOUR_USER;Password=YOUR_PASSWORD;Option=3;" 39 | 'MSSQL 40 | 'const AJAXED_CONNSTRING = "Driver={SQL Server};Server=localhost;Database=YOUR_DB;Uid=YOUR_USER;Pwd=YOUR_PASSWORD;" 41 | 'MS ACCESS 42 | 'const AJAXED_CONNSTRING = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;" 43 | 'PostgreSQL 44 | 'const AJAXED_CONNSTRING = "Driver={PostgreSQL};Server=localhost;Port=5432;Database=YOUR_DB;Uid=YOUR_USER;Pwd=YOUR_PASSWORD;" 45 | 'Oracle 46 | 'const AJAXED_CONNSTRING = "Driver={Microsoft ODBC for Oracle};Server=localhost;Uid=YOUR_USER;Pwd=YOUR_PASSWORD;" 47 | %> -------------------------------------------------------------------------------- /ajaxed/console/configuration.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | '****************************************************************************************** 5 | '* Creator: michal 6 | '* Created on: 2008-04-08 21:38 7 | '* Description: configuration 8 | '* Input: - 9 | '****************************************************************************************** 10 | 11 | set page = new AjaxedPage 12 | with page 13 | .plain = true 14 | .onlyDev = true 15 | .draw() 16 | end with 17 | set page = nothing 18 | 19 | '****************************************************************************************** 20 | '* main 21 | '****************************************************************************************** 22 | sub main() 23 | content() 24 | end sub 25 | 26 | '****************************************************************************************** 27 | '* getComponents 28 | '****************************************************************************************** 29 | function getComponents() 30 | 'TODO: add more components here, which should be checked 31 | comps = array("w3.Upload", "Persits.Jpeg", "Persits.Upload", "Persits.Pdf", "StringBuilderVB.StringBuilder") 32 | 'add the ones from the mailer 33 | mailers = (new Email).supportedComponents 34 | for each m in mailers 35 | redim preserve comps(uBound(comps) + 1) 36 | comps(uBound(comps)) = m 37 | next 38 | found = array() 39 | for each c in comps 40 | on error resume next 41 | set tmp = server.createObject(c) 42 | failed = err <> 0 43 | on error goto 0 44 | if not failed then 45 | redim preserve found(ubound(found) + 1) 46 | found(ubound(found)) = c 47 | end if 48 | next 49 | getComponents = found 50 | end function 51 | 52 | '****************************************************************************************** 53 | '* content 54 | '****************************************************************************************** 55 | sub content() %> 56 | 57 |
    58 | 59 | <% row "Ajaxed version", lib.version & " changes", false %> 60 | <% row "Environment", lib.ENV, true %> 61 | <% row "Scripting Engine", ScriptEngine & " " & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion, false %> 62 | <% row "IIS", request.ServerVariables("SERVER_SOFTWARE"), false %> 63 | <% row "Server name", request.ServerVariables("SERVER_NAME"), false %> 64 | <% row "Components", str.parse(str.arrayToString(getComponents(), ", "), "-"), false %> 65 | <% row "Server time", now(), false %> 66 |
    67 |
    68 |
    69 | 70 | <% row "Default DB", lib.iif(isEmpty(db.defaultConnectionString), "no DB configured. (DB can be configured in your /ajaxedConfig/config.asp)", db.defaultConnectionString), false %> 71 | <% 72 | if not isEmpty(db.defaultConnectionString) then 73 | on error resume next 74 | db.openDefault() 75 | failed = err <> 0 76 | if failed then description = err.description 77 | on error goto 0 78 | if failed then 79 | row "DB Connected", "could not connect. (" & description & ")", false 80 | else 81 | row "DB Connected", "successfully.", false 82 | row "DB Type", db.dbType, false 83 | row "Provider", db.connection.properties("Provider Name") & " " & db.connection.properties("Provider Version"), false 84 | row "OLE DB version", db.connection.properties("OLE DB Version"), false 85 | end if 86 | end if 87 | %> 88 | <% row "ADO version", server.createobject("adodb.connection").version, false %> 89 |
    90 |
    91 |
     
    92 | 93 | <% end sub %> 94 | 95 | <% sub row(name, value, htmlEncode) %> 96 | 97 | 98 | <%= name %>: 99 | <%= lib.iif(htmlEncode, str(value), value) %> 100 | 101 | 102 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/console.js: -------------------------------------------------------------------------------- 1 | var watcher = null; 2 | function scrollToFloor(el) { 3 | $(el).scrollTop = $(el).scrollHeight; 4 | } 5 | function loadContent(file, sender) { 6 | if (watcher) watcher.stop(); 7 | new Ajax.Updater('htmlcontent', file, {evalScripts:true}); 8 | last = $($('htmlcontent').readAttribute('title')); 9 | if (last) last.removeClassName('active'); 10 | $(sender).addClassName('active'); 11 | $('htmlcontent').writeAttribute('title', sender.id); 12 | } 13 | -------------------------------------------------------------------------------- /ajaxed/console/default.asp: -------------------------------------------------------------------------------- 1 | 2 | 3 | <% 4 | set page = new AjaxedPage 5 | with page 6 | .onlyDev = true 7 | .defaultStructure = true 8 | .title = "console" 9 | .draw() 10 | end with 11 | 12 | '****************************************************************************************** 13 | '* header 14 | '****************************************************************************************** 15 | sub header() 16 | str.write("") 17 | page.loadCSSFile "std.css", empty 18 | page.loadCSSFile "screen_borderstyles.css", empty 19 | page.loadJSFile "console.js" 20 | page.loadJSFile "../script.aculo.us/scriptaculous.js" 21 | end sub 22 | 23 | '****************************************************************************************** 24 | '* getVersion 25 | '****************************************************************************************** 26 | function getVersion() 27 | getVersion = "" 28 | set r = new RSS 29 | r.url = "http://www.ajaxed.org/ajaxed/console/version.asp" 30 | r.load() 31 | if not r.failed then getVersion = r.description 32 | end function 33 | 34 | '****************************************************************************************** 35 | '* main 36 | '****************************************************************************************** 37 | sub main() %> 38 | 39 | <% version = getVersion() %> 40 | <% if lib.version <> getVersion() and version <> "" then %> 41 |
    42 | 43 |
    44 |    45 | version <%= version %> is available. 46 | Update now! 47 |    48 |
    49 | 50 |
    51 | <% end if %> 52 | 53 |

    ajaxed logo

    54 | 55 | 78 | 79 |
    80 | 81 |
    82 | ajaxed 83 | project founded by Michal Gabrukiewicz 84 |
    85 | 86 | 89 | 90 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/documentation.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-04-08 21:38 6 | '* Description: documentation 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | set page = new AjaxedPage 11 | with page 12 | .plain = true 13 | .onlyDev = true 14 | .draw() 15 | end with 16 | set page = nothing 17 | 18 | '****************************************************************************************** 19 | '* main 20 | '****************************************************************************************** 21 | sub main() 22 | content() 23 | end sub 24 | 25 | '****************************************************************************************** 26 | '* content 27 | '****************************************************************************************** 28 | sub content() %> 29 | 30 | ajaxed API 31 | official, 32 | local 33 | full programmers class reference (official). 34 |

    35 | 36 | asp-ajaxed google discussion group 37 | discuss issues with other ajaxed developers and contributors. 38 |

    39 | 40 | Tutorials 41 | browse through different ajaxed tutorials on webdevbros. 42 | 43 |


    44 | 45 |
    46 | Want to generate your own documentation? 47 |
    48 | Enter the virtual path of the folder (on your server) you want to create the documentation for. 49 |
    50 | If it's not there copy it to your webroot ;)
    51 |
    52 | 59 | 60 | 61 | 62 | 63 |

    64 | 65 | Documentor manual 66 | read through a quick manual how to document your code. 67 |
    68 |
    69 |
    > Ready.
    70 |
    71 | 72 |
     
    73 | 74 | <% end sub %> 75 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/code_highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | Modified by Michal Gabrukiewicz to emulate good old homesite coloring (with improvements) 5 | 6 | */ 7 | pre code, pre code * { 8 | font: 8pt 'Bitstream Vera Sans Mono','Courier',monospace; 9 | } 10 | pre code[class]:after { 11 | content: 'highlight: ' attr(class); 12 | display: block; 13 | text-align: right; 14 | font-size: smaller; 15 | color: #aaa; 16 | margin-top: 0.5em; 17 | } 18 | pre code { 19 | display: block; 20 | background:#fff; 21 | padding:0.5em 1em; 22 | } 23 | 24 | pre code, 25 | .ruby .subst, 26 | .xml .title, 27 | .lisp .title { 28 | color: #000; 29 | } 30 | 31 | .string, 32 | .title, 33 | .parent, 34 | .tag .attribute .value, 35 | .rules .value, 36 | .rules .value .number, 37 | .preprocessor, 38 | .ruby .symbol, 39 | .instancevar, 40 | .aggregate, 41 | .template_tag, 42 | .django .variable, 43 | .smalltalk .class, 44 | .addition, 45 | .flow, 46 | .stream, 47 | .bash .variable { 48 | color: #408080; 49 | font-style:italic; 50 | } 51 | 52 | .comment, 53 | .annotation, 54 | .template_comment, 55 | .diff .header, 56 | .chunk { 57 | color: #008000; 58 | font-weight:bold; 59 | } 60 | .html .comment { 61 | color:#aaa; 62 | font-weight:normal; 63 | font-style:italic; 64 | } 65 | .vbscript .comment { 66 | color: #008000; 67 | font-style:italic; 68 | } 69 | 70 | .number, 71 | .regexp, 72 | .literal, 73 | .smalltalk .symbol, 74 | .smalltalk .char, 75 | .change { 76 | color: #A500A5; 77 | } 78 | 79 | .javadoc, 80 | .ruby .string, 81 | .decorator, 82 | .filter .argument, 83 | .localvars, 84 | .array, 85 | .attr_selector, 86 | .pi, 87 | .doctype, 88 | .deletion, 89 | .envvar, 90 | .shebang { 91 | color: #88F; 92 | } 93 | 94 | .id, 95 | .phpdoc, 96 | .title, 97 | .vbscript .built_in, 98 | .rsl .built_in, 99 | .cpp .built_in, 100 | .aggregate, 101 | .smalltalk .class, 102 | .winutils, 103 | .bash .variable { 104 | font-weight: bold; 105 | color:#0026FF; 106 | } 107 | 108 | .html .keyword, .attribute, .tag, .tag .attribute .value { 109 | color:#0000CB; 110 | font-weight:normal; 111 | font-style:normal; 112 | } 113 | .tag .attribute .value { 114 | color:#000; 115 | font-style:italic; 116 | } 117 | .vbscript .keyword, .vbscript .literal { 118 | font-weight: bold; 119 | color:#0026FF; 120 | } 121 | .vbscript .literal, .vbscript .built_in { 122 | font-weight: normal; 123 | } 124 | .css .keyword { 125 | color:#FF0000; 126 | } 127 | .css .value, .css .hexcolor { 128 | color:#FF8000; 129 | } 130 | .javascript .title { 131 | color:#000; 132 | font-style:normal; 133 | font-weight:normal; 134 | } 135 | 136 | .html .css, 137 | .html .javascript { 138 | background:#fff; 139 | } 140 | 141 | .html .vbscript { 142 | background:#eee; 143 | } 144 | .ajaxed { 145 | font-weight:bold; 146 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/config.asp: -------------------------------------------------------------------------------- 1 | <% 2 | DOCUMENTOR_KEYWORDS = array("EMPTY", "NOTHING", "BOOL", "OPTIONSHASH", "NULL", "OBJECT", "TRUE", "FALSE", "INT", "STRING", "RECORDSET", "DICTIONARY", "BOOLEAN", "FLOAT", "DOUBLE", "ARRAY") 3 | %> -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/AUTHORS.en.txt: -------------------------------------------------------------------------------- 1 | Syntax highlighting with language autodetection. 2 | 3 | URL: http://softwaremaniacs.org/soft/highlight/en/ 4 | 5 | Original author and current maintainer: 6 | Ivan Sagalaev 7 | 8 | Contributors: 9 | 10 | - Peter Leonov 11 | - Victor Karamzin 12 | - Vsevolod Solovyov 13 | - Anton Kovalyov 14 | - Nikita Ledyaev 15 | - Konstantin Evdokimenko 16 | - Dmitri Roudakov 17 | - Yuri Ivanov 18 | - Vladimir Ermakov 19 | - Vladimir Gubarkov 20 | - Brian Beck 21 | - MajestiC 22 | - Vasily Polovnyov 23 | - Vladimir Epifanov 24 | - Alexander Makarov (http://rmcreative.ru/) 25 | - Vah 26 | - Shuen-Huei Guan 27 | - Jason Diamond -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/AUTHORS.ru.txt: -------------------------------------------------------------------------------- 1 | Подсветка синтаксиса с автоопределением языка. 2 | 3 | URL: http://softwaremaniacs.org/soft/highlight/ 4 | 5 | Первоначальный автор и ведущий проекта: 6 | Иван Сагалаев 7 | 8 | Внесли свой вклад: 9 | 10 | - Петр Леонов 11 | - Виктор Карамзин 12 | - Всеволод Соловьёв 13 | - Антон Ковалёв 14 | - Никита Ледяев 15 | - Константин Евдокименко 16 | - Дмитрий Рудаков 17 | - Юрий Иванов 18 | - Владимир Ермаков 19 | - Владимир Губарьков 20 | - Брайан Бек 21 | - MajestiC 22 | - Василий Половнёв 23 | - Владимир Епифанов 24 | - Александр Макаров (http://rmcreative.ru/) 25 | - Vah 26 | - Шуэн-Хуэй Гуан 27 | - Джейсон Даймонд -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/export.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 12 | Highlited code export 13 | 14 | 15 | 20 | 21 | 24 | 25 | 26 | 57 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
    Write a code snippetGet HTML to paste anywhere (for actual styles and colors see sample.css)
    77 | 78 | 79 | 80 | 81 | 82 |
    83 |
    84 |
    85 | Export script: Vladimir Gubarkov
    86 | Highlighting: highlight.js 87 |
    88 | 89 | 90 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/1c.js: -------------------------------------------------------------------------------- 1 | hljs.IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*'; 2 | hljs.OneS_KEYWORDS = {'процедура':1,'функция':1,'экспорт':1,'перем':1,'конецфункции':1,'конецпроцедуры':1,'если':1,'тогда':1,'иначе':1,'иначеесли':1,'конецесли':1,'попытка':1,'исключение':1,'конецпопытки':1,'ложь':1,'истина':1,'неопределено':1,'и':1,'или':1,'не':1,'null':1,'для':1,'каждого':1,'из':1,'по':1,'цикл':1,'конеццикла':1}; 3 | 4 | hljs.LANGUAGES['1c'] = { 5 | defaultMode: { 6 | lexems: [hljs.IDENT_RE_RU], 7 | contains: ['comment', 'string', 'function', 'preprocessor', 'number'], 8 | keywords: hljs.OneS_KEYWORDS 9 | }, 10 | case_insensitive: true, 11 | modes: [ 12 | hljs.C_LINE_COMMENT_MODE, 13 | { 14 | className: 'string', 15 | begin: '"', end: '"', 16 | contains: ['dquote'], 17 | relevance: 0 18 | }, 19 | { 20 | className: 'string', 21 | begin: '"', end: '$', 22 | contains: ['dquote'] 23 | }, 24 | { 25 | className: 'string', 26 | begin: '\\|', end: '$', 27 | contains: ['dquote'] 28 | }, 29 | { 30 | className: 'string', 31 | begin: '\\|', end: '"', 32 | contains: ['dquote'] 33 | }, 34 | { 35 | className: 'dquote', 36 | begin: '""', end: '^' 37 | }, 38 | { 39 | className: 'number', 40 | begin: hljs.NUMBER_RE, end: '^', 41 | relevance: 0 42 | }, 43 | { 44 | className: 'title', 45 | lexems: [hljs.IDENT_RE_RU], 46 | begin: hljs.IDENT_RE_RU, end: '^' 47 | }, 48 | { 49 | className: 'params', 50 | begin: '\\(', end: '\\)', 51 | lexems: [hljs.IDENT_RE_RU], 52 | keywords: {'знач':1}, 53 | contains: ['string'] 54 | }, 55 | { 56 | className: 'function', 57 | begin: '(процедура|функция)', end: '$', 58 | lexems: [hljs.IDENT_RE_RU], 59 | keywords: {'процедура': 1, 'экспорт':1, 'функция': 1}, 60 | contains: ['title','tail','comment'], 61 | relevance: 0 62 | }, 63 | { 64 | className: 'tail', 65 | begin: '^', endsWithParent: true, 66 | lexems: [hljs.IDENT_RE_RU], 67 | contains: ['params', 'export'] 68 | }, 69 | { 70 | className: 'export', 71 | begin: 'экспорт', endsWithParent: true, 72 | lexems: [hljs.IDENT_RE_RU], 73 | keywords: {'экспорт': 1}, 74 | contains: ['comment'] 75 | }, 76 | { 77 | className: 'preprocessor', 78 | begin: '#', end: '$', 79 | lexems: [hljs.IDENT_RE_RU] 80 | } 81 | ] 82 | }; 83 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/axapta.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Axapta definition (с) Dmitri Roudakov 4 | 5 | */ 6 | hljs.LANGUAGES.axapta = { 7 | defaultMode: { 8 | lexems: [hljs.UNDERSCORE_IDENT_RE], 9 | contains: ['comment', 'string', 'class', 'number', 'preprocessor'], 10 | keywords: {'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 11 | 'reverse':1, 'firstfast':1,'firstonly':1,'forupdate':1,'nofetch':1, 'sum':1, 'avg':1, 'minof':1, 'maxof':1, 'count':1, 'order':1, 'group':1, 'by':1, 'asc':1, 'desc':1, 'index':1, 'hint':1, 'like':1, 12 | 'dispaly':1, 'edit':1, 'client':1, 'server':1, 'ttsbegin':1, 'ttscommit':1, 13 | 'str':1, 'real':1, 'date':1, 'container':1, 'anytype':1, 'common':1, 'div':1,'mod':1 14 | } 15 | }, 16 | modes: [ 17 | { 18 | className: 'class', 19 | lexems: [hljs.UNDERSCORE_IDENT_RE], 20 | begin: '(class |interface )', end: '{', 21 | illegal: ':', 22 | keywords: {'class': 1, 'interface': 1}, 23 | contains: ['inheritance', 'title'] 24 | }, 25 | { 26 | className: 'inheritance', 27 | begin: '(implements|extends)', end: '^', 28 | lexems: [hljs.IDENT_RE], 29 | keywords: {'extends': 1, 'implements': 1}, 30 | relevance: 10 31 | }, 32 | { 33 | className: 'title', 34 | begin: hljs.UNDERSCORE_IDENT_RE, end: '^' 35 | }, 36 | { 37 | className: 'params', 38 | begin: '\\(', end: '\\)', 39 | contains: ['string', 'annotation'] 40 | }, 41 | hljs.C_NUMBER_MODE, 42 | hljs.APOS_STRING_MODE, 43 | hljs.QUOTE_STRING_MODE, 44 | hljs.BACKSLASH_ESCAPE, 45 | hljs.C_LINE_COMMENT_MODE, 46 | hljs.C_BLOCK_COMMENT_MODE, 47 | { 48 | className: 'preprocessor', 49 | begin: '#', end: '$' 50 | } 51 | ] 52 | }; 53 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/bash.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Bash Scripts by vah 4 | 5 | */ 6 | hljs.BASH_LITERAL = {'true' : 1, 'false' : 1} 7 | hljs.LANGUAGES.bash = { 8 | defaultMode: { 9 | lexems: [hljs.IDENT_RE], 10 | contains: ['string', 'shebang', 'comment', 'number', 'test_condition', 'string', 'variable'], 11 | keywords: { 12 | 'keyword': {'if' : 1, 'then' : 1, 'else' : 1, 'fi' : 1, 'for' : 1, 'break' : 1, 'continue' : 1, 'while' : 1, 'in' : 1, 'do' : 1, 'done' : 1, 'echo' : 1, 'exit' : 1, 'return' : 1, 'set' : 1, 'declare' : 1}, 13 | 'literal': hljs.BASH_LITERAL 14 | } 15 | }, 16 | case_insensitive: false, 17 | modes: [ 18 | { 19 | className: 'shebang', 20 | begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)', 21 | end: '^', 22 | relevance: 10 23 | }, 24 | hljs.HASH_COMMENT_MODE, 25 | { 26 | className: 'test_condition', 27 | begin: '\\[ ', 28 | end: ' \\]', 29 | contains: ['string', 'variable', 'number'], 30 | lexems: [hljs.IDENT_RE], 31 | keywords: { 32 | 'literal': hljs.BASH_LITERAL 33 | }, 34 | relevance: 0 35 | }, 36 | { 37 | className: 'test_condition', 38 | begin: '\\[\\[ ', 39 | end: ' \\]\\]', 40 | contains: ['string', 'variable', 'number'], 41 | lexems: [hljs.IDENT_RE], 42 | keywords: { 43 | 'literal': hljs.BASH_LITERAL 44 | } 45 | }, 46 | { 47 | className: 'variable', 48 | begin: '\\$([a-zA-Z0-9_]+)\\b', 49 | end: '^' 50 | }, 51 | { 52 | className: 'variable', 53 | begin: '\\$\\{(([^}])|(\\\\}))+\\}', 54 | end: '^', 55 | contains: ['number'] 56 | }, 57 | { 58 | className: 'string', 59 | begin: '"', end: '"', 60 | illegal: '\\n', 61 | contains: ['escape', 'variable'], 62 | relevance: 0 63 | }, 64 | { 65 | className: 'string', 66 | begin: '"', end: '"', 67 | illegal: '\\n', 68 | contains: ['escape', 'variable'], 69 | relevance: 0 70 | }, 71 | hljs.BACKSLASH_ESCAPE, 72 | hljs.C_NUMBER_MODE, 73 | { 74 | className: 'comment', 75 | begin: '\\/\\/', end: '$', 76 | illegal: '.' 77 | } 78 | ] 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/diff.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Unified and context diff definition (c) Vasily Polovnyov 4 | 5 | */ 6 | hljs.LANGUAGES.diff = { 7 | case_insensitive: true, 8 | defaultMode: { 9 | contains: ['chunk', 'header', 'addition', 'deletion', 'change'] 10 | }, 11 | modes: [ 12 | { 13 | className: 'chunk', 14 | begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$', end:'^', 15 | relevance: 10 16 | }, 17 | { 18 | className: 'chunk', 19 | begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$', end: '^', 20 | relevance: 10 21 | }, 22 | { 23 | className: 'chunk', 24 | begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$', end: '^', 25 | relevance: 10 26 | }, 27 | { 28 | className: 'header', 29 | begin: 'Index: ', end: '$' 30 | }, 31 | { 32 | className: 'header', 33 | begin: '=====', end: '=====$' 34 | }, 35 | { 36 | className: 'header', 37 | begin: '^\\-\\-\\-', end: '$' 38 | }, 39 | { 40 | className: 'header', 41 | begin: '^\\*{3} ', end: '$' 42 | }, 43 | { 44 | className: 'header', 45 | begin: '^\\+\\+\\+', end: '$' 46 | }, 47 | { 48 | className: 'header', 49 | begin: '\\*{5}', end: '\\*{5}$' 50 | }, 51 | { 52 | className: 'addition', 53 | begin: '^\\+', end: '$' 54 | }, 55 | { 56 | className: 'deletion', 57 | begin: '^\\-', end: '$' 58 | }, 59 | { 60 | className: 'change', 61 | begin: '^\\!', end: '$' 62 | } 63 | ] 64 | } 65 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/dos.js: -------------------------------------------------------------------------------- 1 | /* 2 | DOS definition. Alexander Makarov (http://rmcreative.ru/) 3 | */ 4 | hljs.DOS_KEYWORDS = { 5 | 'flow': {'if':1, 'else':1, 'goto':1, 'for':1, 'in':1, 'do':1, 'call':1, 'exit':1, 'not':1, 'exist':1, 'errorlevel':1, 'defined':1, 'equ':1, 'neq':1, 'lss':1, 'leq':1, 'gtr':1, 'geq':1}, 6 | 'keyword':{'shift':1, 'cd':1, 'dir':1, 'echo':1, 'setlocal':1, 'endlocal':1, 'set':1, 'pause':1, 'copy':1}, 7 | 'stream':{'prn':1, 'nul':1, 'lpt3':1, 'lpt2':1, 'lpt1':1, 'con':1, 'com4':1, 'com3':1, 'com2':1, 'com1':1, 'aux':1}, 8 | 'winutils':{'ping':1, 'net':1, 'ipconfig':1, 'taskkill':1, 'xcopy':1, 'ren':1, 'del':1} 9 | }; 10 | 11 | hljs.LANGUAGES.dos = { 12 | case_insensitive: true, 13 | defaultMode: { 14 | lexems: [hljs.IDENT_RE], 15 | contains: ['envvar', 'number', 'comment'], 16 | keywords: hljs.DOS_KEYWORDS 17 | }, 18 | modes: [ 19 | { 20 | className: 'number', 21 | begin: '\\b\\d+', end: '^', 22 | relevance: 0 23 | }, 24 | { 25 | className: 'comment', 26 | begin: '@?rem', end: '$' 27 | }, 28 | { 29 | className: 'envvar', 30 | begin: '%[^ ]+?%', end: '^' 31 | } 32 | ] 33 | }; 34 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/ini.js: -------------------------------------------------------------------------------- 1 | hljs.LANGUAGES.ini = 2 | { 3 | case_insensitive: true, 4 | defaultMode: { 5 | contains: ['comment', 'title', 'setting'], 6 | illegal: '[^\\s]' 7 | }, 8 | modes: [ 9 | { 10 | className: 'comment', 11 | begin: ';', end: '$' 12 | }, 13 | { 14 | className: 'title', 15 | begin: '\\[', end: '\\]' 16 | }, 17 | { 18 | className: 'setting', 19 | begin: '^[a-z]+[ \\t]*=[ \\t]*', end: '$', 20 | contains: ['value'] 21 | }, 22 | { 23 | className: 'value', 24 | begin: '^', endsWithParent: true, 25 | contains: ['string', 'number'], 26 | lexems: [hljs.IDENT_RE], 27 | keywords: {'on': 1, 'off': 1, 'true': 1, 'false': 1, 'yes': 1, 'no': 1} 28 | }, 29 | hljs.QUOTE_STRING_MODE, 30 | hljs.BACKSLASH_ESCAPE, 31 | { 32 | className: 'number', 33 | begin: '\\d+', end: '^' 34 | } 35 | ] 36 | }; 37 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/javascript.js: -------------------------------------------------------------------------------- 1 | hljs.LANGUAGES.javascript = { 2 | defaultMode: { 3 | lexems: [hljs.UNDERSCORE_IDENT_RE], 4 | contains: ['string', 'comment', 'number', 'regexp', 'function'], 5 | keywords: { 6 | 'keyword': {'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1, 'new': 1, 'function': 1, 'do': 1, 'return': 1, 'void': 1, 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1, 'throw': 1, 'case': 1, 'default': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1}, 7 | 'literal': {'true': 1, 'false': 1, 'null': 1} 8 | } 9 | }, 10 | modes: [ 11 | hljs.C_LINE_COMMENT_MODE, 12 | hljs.C_BLOCK_COMMENT_MODE, 13 | hljs.C_NUMBER_MODE, 14 | hljs.APOS_STRING_MODE, 15 | hljs.QUOTE_STRING_MODE, 16 | hljs.BACKSLASH_ESCAPE, 17 | { 18 | className: 'regexp', 19 | begin: '/.*?[^\\\\/]/[gim]*', end: '^' 20 | }, 21 | { 22 | className: 'function', 23 | begin: 'function\\b', end: '{', 24 | lexems: [hljs.UNDERSCORE_IDENT_RE], 25 | keywords: {'function': 1}, 26 | contains: ['title', 'params'] 27 | }, 28 | { 29 | className: 'title', 30 | begin: '[A-Za-z$_][0-9A-Za-z$_]*', end: '^' 31 | }, 32 | { 33 | className: 'params', 34 | begin: '\\(', end: '\\)', 35 | contains: ['string', 'comment'] 36 | } 37 | ] 38 | }; 39 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/lisp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Generic lisp definition (c) Vasily Polovnyov 4 | 5 | */ 6 | hljs.LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*' 7 | hljs.LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?' 8 | hljs.LANGUAGES.lisp = { 9 | case_insensitive: true, 10 | defaultMode: { 11 | lexems: [hljs.LISP_IDENT_RE], 12 | contains: ['literal', 'number', 'string', 'comment', 'quoted', 'list'], 13 | illegal: '[^\\s]' 14 | }, 15 | modes: [ 16 | hljs.QUOTE_STRING_MODE, 17 | { 18 | className: 'number', 19 | begin: hljs.LISP_SIMPLE_NUMBER_RE, end: '^' 20 | }, 21 | { 22 | className: 'number', 23 | begin: '#b[0-1]+(/[0-1]+)?', end: '^' 24 | }, 25 | { 26 | className: 'number', 27 | begin: '#o[0-7]+(/[0-7]+)?', end: '^' 28 | }, 29 | { 30 | className: 'number', 31 | begin: '#x[0-9a-f]+(/[0-9a-f]+)?', end: '^' 32 | }, 33 | { 34 | className: 'number', 35 | begin: '#c\\(' + hljs.LISP_SIMPLE_NUMBER_RE + ' +' + hljs.LISP_SIMPLE_NUMBER_RE, end: '\\)' 36 | }, 37 | { 38 | className: 'comment', 39 | begin: ';', end: '$' 40 | }, 41 | { 42 | className: 'quoted', 43 | begin: '\\\'\\(', end: '\\)', 44 | contains: ['number', 'string', 'variable', 'keyword', 'quoted_list'] 45 | }, 46 | { 47 | className: 'quoted', 48 | begin: '\\(quote ', end: '\\)', 49 | contains: ['number', 'string', 'variable', 'keyword', 'quoted_list'], 50 | lexems: [hljs.LISP_IDENT_RE], 51 | keywords: {'title': {'quote': 1}} 52 | }, 53 | { 54 | className: 'quoted_list', 55 | begin: '\\(', end: '\\)', 56 | contains: ['quoted_list', 'literal', 'number', 'string'] 57 | }, 58 | { 59 | className: 'list', 60 | begin: '\\(', end: '\\)', 61 | contains: ['title','body'] 62 | }, 63 | { 64 | className: 'title', 65 | begin: hljs.LISP_IDENT_RE, end: '^', 66 | endsWithParent: true 67 | }, 68 | { 69 | className: 'body', 70 | begin: '^', endsWithParent: true, excludeEnd: true, 71 | contains: ['quoted', 'list', 'literal', 'number', 'string', 'comment', 'variable', 'keyword'] 72 | }, 73 | { 74 | className: 'keyword', 75 | begin: '[:&]' + hljs.LISP_IDENT_RE, end: '^' 76 | }, 77 | { 78 | className: 'variable', 79 | begin: '\\*', end: '\\*' 80 | }, 81 | { 82 | className: 'literal', 83 | begin: '\\b(t{1}|nil)\\b', end: '^' 84 | } 85 | ] 86 | } 87 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/profile.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Python profiler results (c) Brian Beck 4 | 5 | */ 6 | hljs.LANGUAGES.profile = { 7 | defaultMode: { 8 | lexems: [hljs.UNDERSCORE_IDENT_RE], 9 | contains: ['number', 'builtin', 'filename', 'header', 'summary', 'string', 'function'] 10 | }, 11 | modes: [ 12 | hljs.C_NUMBER_MODE, 13 | hljs.APOS_STRING_MODE, 14 | hljs.QUOTE_STRING_MODE, 15 | { 16 | className: 'summary', 17 | begin: 'function calls', end: '$', 18 | contains: ['number'], 19 | relevance: 10 20 | }, 21 | { 22 | className: 'header', 23 | begin: '(ncalls|tottime|cumtime)', end: '$', 24 | lexems: [hljs.IDENT_RE], 25 | keywords: {'ncalls': 1, 'tottime': 10, 'cumtime': 10, 'filename': 1}, 26 | relevance: 10 27 | }, 28 | { 29 | className: 'function', 30 | begin: '\\(', end: '\\)', 31 | lexems: [hljs.UNDERSCORE_IDENT_RE], 32 | contains: ['title'] 33 | }, 34 | { 35 | className: 'title', 36 | begin: hljs.UNDERSCORE_IDENT_RE, end: '^' 37 | }, 38 | { 39 | className: 'builtin', 40 | begin: '{', end: '}', 41 | contains: ['string'], 42 | excludeBegin: true, excludeEnd: true 43 | }, 44 | { 45 | className: 'filename', 46 | begin: '(/\w|[a-zA-Z_][\da-zA-Z_]+\\.[\da-zA-Z_]{1,3})', end: ':', 47 | excludeEnd: true 48 | } 49 | ] 50 | }; 51 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/renderman.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | RenderMan Languages (c) Konstantin Evdokimenko 4 | 5 | */ 6 | 7 | hljs.LANGUAGES.rib = { 8 | defaultMode: { 9 | lexems: [hljs.UNDERSCORE_IDENT_RE], 10 | illegal: ' 4 | 5 | */ 6 | 7 | hljs.SMALLTALK_KEYWORDS = {'self': 1, 'super': 1, 'nil': 1, 'true': 1, 'false': 1, 'thisContext': 1}; // only 6 8 | hljs.VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*'; 9 | 10 | hljs.LANGUAGES.smalltalk = { 11 | defaultMode: { 12 | lexems: [hljs.UNDERSCORE_IDENT_RE], 13 | contains: ['comment', 'string', 'class', 'method', 14 | 'number', 'symbol', 'char', 'localvars', 'array'], 15 | keywords: hljs.SMALLTALK_KEYWORDS 16 | }, 17 | modes: [ 18 | { 19 | className: 'class', 20 | begin: '\\b[A-Z][A-Za-z0-9_]*', end: '^', 21 | relevance: 0 22 | }, 23 | { 24 | className: 'symbol', 25 | begin: '#' + hljs.UNDERSCORE_IDENT_RE, end: '^' 26 | }, 27 | hljs.C_NUMBER_MODE, 28 | hljs.APOS_STRING_MODE, 29 | { 30 | className: 'comment', 31 | begin: '"', end: '"', 32 | relevance: 0 33 | }, 34 | { 35 | className: 'method', 36 | begin: hljs.VAR_IDENT_RE+':', end:'^' 37 | }, 38 | { 39 | className: 'char', 40 | begin: '\\$.{1}', end: '^' 41 | }, 42 | { 43 | className: 'localvars', 44 | begin: '\\|\\s*(('+hljs.VAR_IDENT_RE+')\\s*)+\\|', end: '^', 45 | relevance: 10 46 | }, 47 | { 48 | className: 'array', 49 | begin: '\\#\\(', end: '\\)', 50 | contains: ['string', 'char', 'number', 'symbol'] 51 | } 52 | ] 53 | }; 54 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/sql.js: -------------------------------------------------------------------------------- 1 | hljs.SQL_KEYWORDS = {'all': 1, 'partial': 1, 'global': 1, 'month': 1, 'current_timestamp': 1, 'using': 1, 'go': 1, 'revoke': 1, 'smallint': 1, 'indicator': 1, 'end-exec': 1, 'disconnect': 1, 'zone': 1, 'with': 1, 'character': 1, 'assertion': 1, 'to': 1, 'add': 1, 'current_user': 1, 'usage': 1, 'input': 1, 'local': 1, 'alter': 1, 'match': 1, 'collate': 1, 'real': 1, 'then': 1, 'rollback': 1, 'get': 1, 'read': 1, 'timestamp': 1, 'session_user': 1, 'not': 1, 'integer': 1, 'bit': 1, 'unique': 1, 'day': 1, 'minute': 1, 'desc': 1, 'insert': 1, 'execute': 1, 'like': 1, 'level': 1, 'decimal': 1, 'drop': 1, 'continue': 1, 'isolation': 1, 'found': 1, 'where': 1, 'constraints': 1, 'domain': 1, 'right': 1, 'national': 1, 'some': 1, 'module': 1, 'transaction': 1, 'relative': 1, 'second': 1, 'connect': 1, 'escape': 1, 'close': 1, 'system_user': 1, 'for': 1, 'deferred': 1, 'section': 1, 'cast': 1, 'current': 1, 'sqlstate': 1, 'allocate': 1, 'intersect': 1, 'deallocate': 1, 'numeric': 1, 'public': 1, 'preserve': 1, 'full': 1, 'goto': 1, 'initially': 1, 'asc': 1, 'no': 1, 'key': 1, 'output': 1, 'collation': 1, 'group': 1, 'by': 1, 'union': 1, 'session': 1, 'both': 1, 'last': 1, 'language': 1, 'constraint': 1, 'column': 1, 'of': 1, 'space': 1, 'foreign': 1, 'deferrable': 1, 'prior': 1, 'connection': 1, 'unknown': 1, 'action': 1, 'commit': 1, 'view': 1, 'or': 1, 'first': 1, 'into': 1, 'float': 1, 'year': 1, 'primary': 1, 'cascaded': 1, 'except': 1, 'restrict': 1, 'set': 1, 'references': 1, 'names': 1, 'table': 1, 'outer': 1, 'open': 1, 'select': 1, 'size': 1, 'are': 1, 'rows': 1, 'from': 1, 'prepare': 1, 'distinct': 1, 'leading': 1, 'create': 1, 'only': 1, 'next': 1, 'inner': 1, 'authorization': 1, 'schema': 1, 'corresponding': 1, 'option': 1, 'declare': 1, 'precision': 1, 'immediate': 1, 'else': 1, 'timezone_minute': 1, 'external': 1, 'varying': 1, 'translation': 1, 'true': 1, 'case': 1, 'exception': 1, 'join': 1, 'hour': 1, 'default': 1, 'double': 1, 'scroll': 1, 'value': 1, 'cursor': 1, 'descriptor': 1, 'values': 1, 'dec': 1, 'fetch': 1, 'procedure': 1, 'delete': 1, 'and': 1, 'false': 1, 'int': 1, 'is': 1, 'describe': 1, 'char': 1, 'as': 1, 'at': 1, 'in': 1, 'varchar': 1, 'null': 1, 'trailing': 1, 'any': 1, 'absolute': 1, 'current_time': 1, 'end': 1, 'grant': 1, 'privileges': 1, 'when': 1, 'cross': 1, 'check': 1, 'write': 1, 'current_date': 1, 'pad': 1, 'begin': 1, 'temporary': 1, 'exec': 1, 'time': 1, 'update': 1, 'catalog': 1, 'user': 1, 'sql': 1, 'date': 1, 'on': 1, 'identity': 1, 'timezone_hour': 1, 'natural': 1, 'whenever': 1, 'interval': 1, 'work': 1, 'order': 1, 'cascade': 1, 'diagnostics': 1, 'nchar': 1, 'having': 1, 'left': 1}; 2 | 3 | hljs.LANGUAGES.sql = 4 | { 5 | case_insensitive: true, 6 | defaultMode: 7 | { 8 | lexems: [hljs.IDENT_RE], 9 | contains: ['string', 'number', 'comment'], 10 | keywords: { 11 | 'keyword': hljs.SQL_KEYWORDS, 12 | 'aggregate': {'count': 1, 'sum': 1, 'min': 1, 'max': 1, 'avg': 1} 13 | } 14 | }, 15 | 16 | modes: [ 17 | hljs.C_NUMBER_MODE, 18 | hljs.C_BLOCK_COMMENT_MODE, 19 | { 20 | className: 'comment', 21 | begin: '--', end: '$' 22 | }, 23 | { 24 | className: 'string', 25 | begin: '\'', end: '\'', 26 | contains: ['escape', 'squote'], 27 | relevance: 0 28 | }, 29 | { 30 | className: 'squote', 31 | begin: '\'\'', end: '^' 32 | }, 33 | { 34 | className: 'string', 35 | begin: '"', end: '"', 36 | contains: [ 'escape', 'dquote'], 37 | relevance: 0 38 | }, 39 | { 40 | className: 'dquote', 41 | begin: '""', end: '^' 42 | }, 43 | { 44 | className: 'string', 45 | begin: '`', end: '`', 46 | contains: ['escape'] 47 | }, 48 | hljs.BACKSLASH_ESCAPE 49 | ] 50 | }; 51 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/languages/vbscript.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | VBScript definition (c) Nikita Ledyaev 4 | 5 | */ 6 | hljs.LANGUAGES.vbscript = { 7 | defaultMode: { 8 | lexems: [hljs.IDENT_RE], 9 | contains: ['string', 'comment', 'number', 'built_in'], 10 | keywords: { 11 | 'keyword': {'call' : 1,'class' : 1,'const' : 1,'dim' : 1,'do' : 1,'loop' : 1,'erase' : 1,'execute' : 1,'executeglobal' : 1,'exit' : 1,'for' : 1,'each' : 1,'next' : 1,'function' : 1,'if' : 1,'then' : 1,'else' : 1,'on' : 1, 'error' : 1,'option' : 1, 'explicit' : 1, 'new': 1, 'private' : 1,'property' : 1,'let' : 1,'get' : 1,'public' : 1,'randomize' : 1,'redim' : 1,'rem' : 1,'select' : 1,'case' : 1,'set' : 1,'stop' : 1,'sub' : 1,'while' : 1,'wend' : 1,'with' : 1, 'end' : 1, 'to' : 1, 'elseif': 1, 'is': 1, 'or': 1, 'xor': 1, 'and': 1, 'not': 1, 'class_initialize': 1, 'class_terminate': 1, 'default': 1, 'preserve': 1, 'in': 1, 'me': 1, 'byval': 1, 'byref': 1, 'step': 1, 'resume': 1, 'goto': 1}, 12 | 'built_in': {'lcase': 1, 'month': 1, 'vartype': 1, 'instrrev': 1, 'ubound': 1, 'setlocale': 1, 'getobject': 1, 'rgb': 1, 'getref': 1, 'string': 1, 'weekdayname': 1, 'rnd': 1, 'dateadd': 1, 'monthname': 1, 'now': 1, 'day': 1, 'minute': 1, 'isarray': 1, 'cbool': 1, 'round': 1, 'formatcurrency': 1, 'conversions': 1, 'csng': 1, 'timevalue': 1, 'second': 1, 'year': 1, 'space': 1, 'abs': 1, 'clng': 1, 'timeserial': 1, 'fixs': 1, 'len': 1, 'asc': 1, 'isempty': 1, 'maths': 1, 'dateserial': 1, 'atn': 1, 'timer': 1, 'isobject': 1, 'filter': 1, 'weekday': 1, 'datevalue': 1, 'ccur': 1, 'isdate': 1, 'instr': 1, 'datediff': 1, 'formatdatetime': 1, 'replace': 1, 'isnull': 1, 'right': 1, 'sgn': 1, 'array': 1, 'snumeric': 1, 'log': 1, 'cdbl': 1, 'hex': 1, 'chr': 1, 'lbound': 1, 'msgbox': 1, 'ucase': 1, 'getlocale': 1, 'cos': 1, 'cdate': 1, 'cbyte': 1, 'rtrim': 1, 'join': 1, 'hour': 1, 'oct': 1, 'typename': 1, 'trim': 1, 'strcomp': 1, 'int': 1, 'createobject': 1, 'loadpicture': 1, 'tan': 1, 'formatnumber': 1, 'mid': 1, 'scriptenginebuildversion': 1, 'scriptengine': 1, 'split': 1, 'scriptengineminorversion': 1, 'cint': 1, 'sin': 1, 'datepart': 1, 'ltrim': 1, 'sqr': 1, 'scriptenginemajorversion': 1, 'time': 1, 'derived': 1, 'eval': 1, 'date': 1, 'formatpercent': 1, 'exp': 1, 'inputbox': 1, 'left': 1, 'ascw': 1, 'chrw': 1, 'regexp': 1, 'server': 1, 'response': 1, 'request': 1, 'cstr': 1, 'err': 1}, 13 | 'literal': {'true': 1, 'false': 1, 'null': 1, 'nothing': 1, 'empty': 1}, 14 | 'ajaxed': {'str': 1, 'lib': 1, 'local': 1, 'db': 1, 'ajaxedpage': 1, 'cache': 1, 'database': 1, 'datacontainer': 1, 'datatable': 1, 'dropdown': 1, 'email': 1, 'library': 1, 'logger': 1, 'md5': 1, 'rss': 1, 'stringbuilder': 1, 'stringoperations': 1, 'testfixture': 1, 'texttemplate': 1, 'validator': 1} 15 | } 16 | }, 17 | case_insensitive: true, 18 | modes: [ 19 | hljs.QUOTE_STRING_MODE, 20 | hljs.BACKSLASH_ESCAPE, 21 | { 22 | className: 'comment', 23 | begin: '\'', end: '$' 24 | }, 25 | hljs.C_NUMBER_MODE 26 | ] 27 | }; 28 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; 9 | background: white; color: black; 10 | border: solid #CCC 1px; 11 | } 12 | 13 | .string, 14 | .attribute .value, 15 | .filter .argument, 16 | .addition, 17 | .change { 18 | color: #888; 19 | } 20 | 21 | .comment, 22 | .template_comment, 23 | .shebang, 24 | .doctype, 25 | .pi, 26 | .javadoc, 27 | .deletion { 28 | color: #CCC; 29 | } 30 | 31 | .keyword, 32 | .tag .title, 33 | .ini .title, 34 | .winutils, 35 | .flow, 36 | .lisp .title { 37 | font-weight: bold; 38 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code[class]:after { 8 | content: 'highlight: ' attr(class); 9 | display: block; text-align: right; 10 | font-size: smaller; 11 | color: #CCC; background: white; 12 | border-top: solid 1px black; 13 | padding-top: 0.5em; 14 | } 15 | 16 | pre code { 17 | display: block; 18 | background: #444; 19 | } 20 | 21 | .keyword, 22 | .literal, 23 | .change, 24 | .winutils, 25 | .flow, 26 | .lisp .title { 27 | color: white; 28 | } 29 | 30 | pre code, 31 | .ruby .subst { 32 | color: #DDD; 33 | } 34 | 35 | .string, 36 | .function .title, 37 | .class .title, 38 | .ini .title, 39 | .tag .attribute .value, 40 | .css .rules .value, 41 | .preprocessor, 42 | .ruby .symbol, 43 | .ruby .instancevar, 44 | .ruby .class .parent, 45 | .built_in, 46 | .sql .aggregate, 47 | .django .template_tag, 48 | .django .variable, 49 | .smalltalk .class, 50 | .javadoc, 51 | .ruby .string, 52 | .django .filter .argument, 53 | .smalltalk .localvars, 54 | .smalltalk .array, 55 | .css .attr_selector, 56 | .addition, 57 | .stream, 58 | .envvar { 59 | color: #D88; 60 | } 61 | 62 | .comment, 63 | .java .annotation, 64 | .python .decorator, 65 | .template_comment, 66 | .pi, 67 | .doctype, 68 | .deletion, 69 | .shebang { 70 | color: #777; 71 | } 72 | 73 | .keyword, 74 | .literal, 75 | .css .id, 76 | .phpdoc, 77 | .function .title, 78 | .class .title, 79 | .vbscript .built_in, 80 | .sql .aggregate, 81 | .rsl .built_in, 82 | .smalltalk .class, 83 | .xml .tag .title, 84 | .diff .header, 85 | .chunk, 86 | .winutils, 87 | .bash .variable, 88 | .lisp .title { 89 | font-weight: bold; 90 | } 91 | 92 | .html .css, 93 | .html .javascript, 94 | .html .vbscript { 95 | opacity: 0.5; 96 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code[class]:after { 8 | content: 'highlight: ' attr(class); 9 | display: block; text-align: right; 10 | font-size: smaller; 11 | color: #CCC; background: white; 12 | border-top: solid 1px; 13 | padding-top: 0.5em; 14 | } 15 | 16 | pre code { 17 | display: block; 18 | background: #F0F0F0; 19 | } 20 | 21 | pre code, 22 | .ruby .subst, 23 | .xml .title, 24 | .lisp .title { 25 | color: black; 26 | } 27 | 28 | .string, 29 | .title, 30 | .parent, 31 | .tag .attribute .value, 32 | .rules .value, 33 | .rules .value .number, 34 | .preprocessor, 35 | .ruby .symbol, 36 | .instancevar, 37 | .aggregate, 38 | .template_tag, 39 | .django .variable, 40 | .smalltalk .class, 41 | .addition, 42 | .flow, 43 | .stream, 44 | .bash .variable { 45 | color: #800; 46 | } 47 | 48 | .comment, 49 | .annotation, 50 | .template_comment, 51 | .diff .header, 52 | .chunk { 53 | color: #888; 54 | } 55 | 56 | .number, 57 | .regexp, 58 | .literal, 59 | .smalltalk .symbol, 60 | .smalltalk .char, 61 | .change { 62 | color: #080; 63 | } 64 | 65 | .javadoc, 66 | .ruby .string, 67 | .decorator, 68 | .filter .argument, 69 | .localvars, 70 | .array, 71 | .attr_selector, 72 | .pi, 73 | .doctype, 74 | .deletion, 75 | .envvar, 76 | .shebang { 77 | color: #88F; 78 | } 79 | 80 | .keyword, 81 | .id, 82 | .phpdoc, 83 | .title, 84 | .vbscript .built_in, 85 | .rsl .built_in, 86 | .cpp .built_in, 87 | .aggregate, 88 | .smalltalk .class, 89 | .winutils, 90 | .bash .variable { 91 | font-weight: bold; 92 | } 93 | 94 | .html .css, 95 | .html .javascript, 96 | .html .vbscript { 97 | opacity: 0.5; 98 | } 99 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/far.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | FAR Style (c) MajestiC 4 | 5 | */ 6 | 7 | pre code[class]:after { 8 | content: 'highlight: ' attr(class); 9 | display: block; text-align: right; 10 | font-size: smaller; 11 | color: #CCC; background: white; 12 | border-top: solid 1px; 13 | padding-top: 0.5em; 14 | } 15 | 16 | pre code { 17 | display: block; 18 | background: #000080; 19 | } 20 | 21 | pre code, 22 | .ruby .subst { 23 | color: #0FF; 24 | } 25 | 26 | .string, 27 | .ruby .string, 28 | .function .title, 29 | .class .title, 30 | .ini .title, 31 | .tag .attribute .value, 32 | .css .rules .value, 33 | .css .rules .value .number, 34 | .preprocessor, 35 | .ruby .symbol, 36 | .built_in, 37 | .sql .aggregate, 38 | .django .template_tag, 39 | .django .variable, 40 | .smalltalk .class, 41 | .addition { 42 | color: #FF0; 43 | } 44 | 45 | .change, 46 | .envvar, 47 | .bash .variable { 48 | color: #FFF; 49 | } 50 | 51 | .comment, 52 | .phpdoc, 53 | .javadoc, 54 | .java .annotation, 55 | .template_comment, 56 | .deletion { 57 | color: #888; 58 | } 59 | 60 | .number, 61 | .regexp, 62 | .literal, 63 | .smalltalk .symbol, 64 | .smalltalk .char { 65 | color: #0F0; 66 | } 67 | 68 | .python .decorator, 69 | .django .filter .argument, 70 | .smalltalk .localvars, 71 | .smalltalk .array, 72 | .css .attr_selector, 73 | .xml .pi, 74 | .diff .header, 75 | .chunk, 76 | .shebang { 77 | color: #008080; 78 | } 79 | 80 | .keyword, 81 | .css .id, 82 | .function .title, 83 | .class .title, 84 | .ini .title, 85 | .vbscript .built_in, 86 | .sql .aggregate, 87 | .rsl .built_in, 88 | .smalltalk .class, 89 | .xml .tag .title, 90 | .winutils, 91 | .flow, 92 | .lisp .title { 93 | color: #FFF; 94 | font-weight: bold; 95 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/homesite.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code[class]:after { 8 | content: 'highlight: ' attr(class); 9 | display: block; text-align: right; 10 | font-size: smaller; 11 | color: #CCC; background: white; 12 | border-top: solid 1px; 13 | padding-top: 0.5em; 14 | } 15 | 16 | pre code { 17 | display: block; 18 | background: #F0F0F0; 19 | } 20 | 21 | pre code, 22 | .ruby .subst, 23 | .xml .title, 24 | .lisp .title { 25 | color: black; 26 | } 27 | 28 | .string, 29 | .title, 30 | .parent, 31 | .tag .attribute .value, 32 | .rules .value, 33 | .rules .value .number, 34 | .preprocessor, 35 | .ruby .symbol, 36 | .instancevar, 37 | .aggregate, 38 | .template_tag, 39 | .django .variable, 40 | .smalltalk .class, 41 | .addition, 42 | .flow, 43 | .stream, 44 | .bash .variable { 45 | color: #800; 46 | } 47 | 48 | .comment, 49 | .annotation, 50 | .template_comment, 51 | .diff .header, 52 | .chunk { 53 | color: #888; 54 | } 55 | 56 | .number, 57 | .regexp, 58 | .literal, 59 | .smalltalk .symbol, 60 | .smalltalk .char, 61 | .change { 62 | color: #080; 63 | } 64 | 65 | .javadoc, 66 | .ruby .string, 67 | .decorator, 68 | .filter .argument, 69 | .localvars, 70 | .array, 71 | .attr_selector, 72 | .pi, 73 | .doctype, 74 | .deletion, 75 | .envvar, 76 | .shebang { 77 | color: #88F; 78 | } 79 | 80 | .vbscript { 81 | background:#aaa; 82 | } 83 | 84 | .keyword, 85 | .id, 86 | .phpdoc, 87 | .title, 88 | .vbscript .built_in, 89 | .rsl .built_in, 90 | .cpp .built_in, 91 | .aggregate, 92 | .smalltalk .class, 93 | .winutils, 94 | .bash .variable { 95 | font-weight: bold; 96 | color:red; 97 | } 98 | 99 | .html .css, 100 | .html .javascript, 101 | .html .vbscript { 102 | opacity: 0.5; 103 | } 104 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/idea.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Intellij Idea-like styling (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | font: 12px "Monospaced", monospace; 9 | display: block; 10 | color: #000; 11 | background: #fff; 12 | } 13 | 14 | .subst, .title { 15 | font-weight: normal; 16 | color: #000; 17 | } 18 | 19 | .comment, .template_comment, .javadoc, .diff .header { 20 | color: #808080; 21 | font-style: italic; 22 | } 23 | 24 | .annotation, .decorator, .preprocessor, .doctype, .pi, .chunk, .shebang { 25 | color: #808000; 26 | } 27 | 28 | .tag, .pi { 29 | background: #efefef; 30 | } 31 | 32 | .tag .title, .id, .attr_selector, .literal, .keyword, .hexcolor, .css .function, .ini .title, .css .class, .list .title { 33 | font-weight: bold; 34 | color: #000080; 35 | } 36 | 37 | .attribute, .rules .keyword, .number, .regexp { 38 | font-weight: bold; 39 | color: #0000ff; 40 | } 41 | 42 | .number, .regexp { 43 | font-weight: normal; 44 | } 45 | 46 | .string, .value, .filter .argument, .css .function .params { 47 | color: #008000; 48 | font-weight: bold; 49 | } 50 | 51 | .symbol, .char { 52 | color: #000; 53 | background: #d0eded; 54 | font-style: italic; 55 | } 56 | 57 | .phpdoc, .javadoctag { 58 | text-decoration: underline; 59 | } 60 | 61 | .variable, .envvar { 62 | color: #660e7a; 63 | } 64 | 65 | .addition { 66 | background: #baeeba; 67 | } 68 | 69 | .deletion { 70 | background: #ffc8bd; 71 | } 72 | 73 | .diff .change { 74 | background: #bccff9; 75 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/sunburst.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Sunburst-like style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | font: 12px / 1.3em 'Lucida Console', 'courier new', monospace; 9 | color: #f8f8f8; 10 | } 11 | 12 | pre { 13 | background: #000; 14 | } 15 | 16 | .comment, .template_comment, .javadoc { 17 | color: #aeaeae; 18 | font-style: italic; 19 | } 20 | 21 | .keyword, .ruby .function .keyword { 22 | color: #E28964; 23 | } 24 | 25 | .function .keyword, .sub .keyword, .method, .list .title { 26 | color: #99CF50; 27 | } 28 | 29 | .string, .attribute .value, .cdata, .filter .argument, .attr_selector { 30 | color: #65B042; 31 | } 32 | 33 | .subst { 34 | color: #DAEFA3; 35 | } 36 | 37 | .regexp { 38 | color: #E9C062; 39 | } 40 | 41 | .function .title, .sub .identifier, .pi, .tag, .tag .keyword, .decorator, .ini .title, .shebang { 42 | color: #89BDFF; 43 | } 44 | 45 | .class .title, .smalltalk .class, .javadoctag, .phpdoc { 46 | text-decoration: underline; 47 | } 48 | 49 | .symbol, .number { 50 | color: #3387CC; 51 | } 52 | 53 | .params, .variable { 54 | color: #3E87E3; 55 | } 56 | 57 | .css .keyword { 58 | color: #CDA869; 59 | } 60 | 61 | .css .class { 62 | color: #9B703F; 63 | } 64 | 65 | .rules .keyword { 66 | color: #C5AF75; 67 | } 68 | 69 | .rules .value { 70 | color: #CF6A4C; 71 | } 72 | 73 | .css .id { 74 | color: #8B98AB; 75 | } 76 | 77 | .annotation { 78 | color: #9B859D; 79 | } 80 | 81 | .preprocessor { 82 | color: #8996A8; 83 | } 84 | 85 | .hexcolor, .css .value .number { 86 | color: #DD7B3B; 87 | } 88 | 89 | .css .function { 90 | color: #DAD085; 91 | } 92 | 93 | .diff .header, .chunk { 94 | background-color: #0E2231; 95 | color: #F8F8F8; 96 | font-style: italic; 97 | } 98 | 99 | .diff .change { 100 | background-color: #4A410D; 101 | color: #F8F8F8; 102 | } 103 | 104 | .addition { 105 | background-color: #253B22; 106 | color: #F8F8F8; 107 | } 108 | 109 | .deletion { 110 | background-color: #420E09; 111 | color: #F8F8F8; 112 | } -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/vs.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Visual Studio-like style based on original C# coloring by Jason Diamond 4 | 5 | */ 6 | .comment, 7 | .annotation, 8 | .template_comment, 9 | .diff .header, 10 | .chunk { 11 | color: rgb(0, 128, 0); 12 | } 13 | 14 | .keyword, 15 | .id, 16 | .title, 17 | .vbscript .built_in, 18 | .rsl .built_in, 19 | .cpp .built_in, 20 | .aggregate, 21 | .smalltalk .class, 22 | .winutils, 23 | .bash .variable { 24 | color: rgb(0, 0, 255); 25 | } 26 | 27 | .string, 28 | .title, 29 | .parent, 30 | .tag .attribute .value, 31 | .rules .value, 32 | .rules .value .number, 33 | .ruby .symbol, 34 | .instancevar, 35 | .aggregate, 36 | .template_tag, 37 | .django .variable, 38 | .addition, 39 | .flow, 40 | .stream { 41 | color: rgb(163, 21, 21); 42 | } 43 | 44 | .ruby .string, 45 | .decorator, 46 | .filter .argument, 47 | .localvars, 48 | .array, 49 | .attr_selector, 50 | .pi, 51 | .doctype, 52 | .deletion, 53 | .envvar, 54 | .shebang, 55 | .preprocessor, 56 | .userType { 57 | color: rgb(43, 145, 175); 58 | } 59 | 60 | .phpdoc, 61 | .javadoc, 62 | .xmlDocTag { 63 | color: rgb(128, 128, 128); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/styles/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code[class]:after { 9 | content: 'highlight: ' attr(class); 10 | display: block; text-align: right; 11 | font-size: smaller; 12 | color: #CCC; background: white; 13 | border-top: solid 1px black; 14 | padding-top: 0.5em; 15 | } 16 | 17 | pre code { 18 | display: block; 19 | background: #3F3F3F; 20 | color: #DCDCDC; 21 | } 22 | 23 | .keyword, 24 | .tag, 25 | .django .tag, 26 | .django .keyword, 27 | .css .class, 28 | .css .id, 29 | .lisp .title { 30 | color: #E3CEAB; 31 | } 32 | 33 | .django .template_tag, 34 | .django .variable, 35 | .django .filter .argument { 36 | color: #DCDCDC; 37 | } 38 | 39 | .number { 40 | color: #8CD0D3; 41 | } 42 | 43 | .dos .envvar, 44 | .dos .stream, 45 | .variable { 46 | color: #EFDCBC; 47 | } 48 | 49 | .dos .flow, 50 | .diff .change, 51 | .python .exception, 52 | .python .built_in, 53 | .literal { 54 | color: #EFEFAF; 55 | } 56 | 57 | .diff .chunk, 58 | .ruby .subst { 59 | color: #8F8F8F; 60 | } 61 | 62 | .dos .keyword, 63 | .python .decorator, 64 | .class .title, 65 | .function .title, 66 | .ini .title, 67 | .diff .header, 68 | .ruby .class .parent { 69 | color: #efef8f; 70 | } 71 | 72 | .dos .winutils, 73 | .ruby .symbol, 74 | .ruby .string, 75 | .ruby .instancevar { 76 | color: #DCA3A3; 77 | } 78 | 79 | .diff .deletion, 80 | .string, 81 | .tag .attribute .value, 82 | .preprocessor, 83 | .built_in, 84 | .sql .aggregate, 85 | .javadoc, 86 | .smalltalk .class, 87 | .smalltalk .localvars, 88 | .smalltalk .array, 89 | .css .rules .value, 90 | .css .attr_selector { 91 | color: #CC9393; 92 | } 93 | 94 | .shebang, 95 | .diff .addition, 96 | .comment, 97 | .java .annotation, 98 | .template_comment, 99 | .pi, 100 | .doctype { 101 | color: #7F9F7F; 102 | } 103 | 104 | .html .css, 105 | .html .javascript { 106 | opacity: 0.5; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/highlight/wp_highlight.js.php: -------------------------------------------------------------------------------- 1 | $language) { 28 | $languages[$i] = '\'' . trim($language) . '\''; 29 | } 30 | $languages_str = implode(', ', $languages); 31 | } 32 | ?> 33 | 34 | 35 | 38 | 39 | 43 | 46 |

    Options updated.

    66 |
    67 |
    68 |

    highlight.js options

    69 | 70 |
    71 |

    72 |

    List here languages that you want to highlight on your blog like this: php, html, css. Empty string means "all known languages". For the list 73 | of supported languages refer to highlight.js homepage.

    74 |
    75 | 76 |
    77 |

    78 |

    Let's you place the script in a convenient place

    79 |
    80 | 81 |
    82 |

    83 |

    You can choose one of the bundled style files or leave it empty

    84 |
    85 | 86 |
    87 |

    88 |

    89 |

    Normally styling of code snippets goes into site's main CSS files. But you can 90 | write it here if you can't access site's CSS or just like it this way.

    91 |
    92 | 93 |
    94 | 95 |
    96 |
    97 |
    101 | -------------------------------------------------------------------------------- /ajaxed/console/documentor/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/console/documentor/icon.png -------------------------------------------------------------------------------- /ajaxed/console/img/fav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/console/img/fav.png -------------------------------------------------------------------------------- /ajaxed/console/img/tab-round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/console/img/tab-round.png -------------------------------------------------------------------------------- /ajaxed/console/logFile.asp: -------------------------------------------------------------------------------- 1 | 2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-05-05 22:21 6 | '* Description: views a given logfile 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | 'we dont want any logs on of this page because of "watch logfile feature" 11 | lib.logger.logLevel = 0 12 | set page = new AjaxedPage 13 | with page 14 | .plain = true 15 | .onlyDev = true 16 | .draw() 17 | end with 18 | set page = nothing 19 | 20 | '****************************************************************************************** 21 | '* main 22 | '****************************************************************************************** 23 | sub main() 24 | path = page.RF("file") 25 | if path = "" then exit sub 26 | path = server.mapPath(path) 27 | if not lib.fso.fileExists(path) then 28 | str.write("") 29 | exit sub 30 | end if 31 | set stream = lib.fso.openTextFile(path, 1, false) 32 | lineFeed = lib.iif(page.RF("moreSpace") = "1", "

    ", "
    ") 33 | logsContent = replace(str(stream.readAll()), vbNewLine, lineFeed) 34 | if page.RF("removeAscii") = "1" then 35 | str.write(removeAsciiCodes(logsContent)) 36 | else 37 | str.write(logsContent) 38 | end if 39 | stream.close() 40 | 'delete the file if we watch it 41 | if page.RFHas("live") then lib.fso.deleteFile(path) 42 | end sub 43 | 44 | '****************************************************************************************** 45 | '* removeAsciiCodes 46 | '****************************************************************************************** 47 | function removeAsciiCodes(val) 48 | set r = new Regexp 49 | r.global = true 50 | r.pattern = chr(27) & "\[[\d;]{1,8}m" 51 | removeAsciiCodes = r.replace(val, "") 52 | end function 53 | %> -------------------------------------------------------------------------------- /ajaxed/console/logs.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-04-08 21:38 6 | '* Description: logs 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | set page = new AjaxedPage 11 | with page 12 | .plain = true 13 | .onlyDev = true 14 | .draw() 15 | end with 16 | set page = nothing 17 | 18 | '****************************************************************************************** 19 | '* callback 20 | '****************************************************************************************** 21 | sub callback(a) 22 | if a = "clear" then 23 | lib.logger.clearLogs() 24 | page.return(true) 25 | end if 26 | end sub 27 | 28 | '****************************************************************************************** 29 | '* main 30 | '****************************************************************************************** 31 | sub main() 32 | content() 33 | end sub 34 | 35 | '****************************************************************************************** 36 | '* content 37 | '****************************************************************************************** 38 | sub content() %> 39 | 40 | Ajaxed offers the possibility of easy logging. The lib.loggger property 41 | holds a ready-to-use Logger instance. All logfiles are stored in 42 | <%= lib.logger.path %> named after the current environment. 43 | 44 |

    45 | 46 | 75 | 76 |
    77 |
    78 |
    79 | <% if lib.fso.folderExists(server.mapPath(lib.logger.path)) then %> 80 | <% for each f in lib.fso.getFolder(server.mappath(lib.logger.path)).files %> 81 |
    82 | <% id = lib.getUniqueID() %> 83 | 84 | 85 |
    86 | <% next %> 87 | <% else %> 88 | No log files found. 89 | <% end if %> 90 |
    91 | 92 | 93 |
    94 | 95 | 96 |
    97 | 98 | 99 |

    100 | 103 |
    104 |
    105 |
    106 |
    107 |
    108 |
    109 |
     
    110 |
    111 | 112 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/regex.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | regexError = "" 4 | set page = new AjaxedPage 5 | with page 6 | .onlyDev = true 7 | .defaultStructure = true 8 | .plain = true 9 | .draw() 10 | end with 11 | set page = nothing 12 | 13 | '****************************************************************************************** 14 | '* callback 15 | '****************************************************************************************** 16 | sub callback(a) 17 | if not a = "exec" then exit sub 18 | 19 | session("ajaxedConsoleRegexPattern") = page.RF("pattern") 20 | session("ajaxedConsoleRegexSourceString") = page.RF("searchstring") 21 | if page.RF("type") = "execute" then 22 | set result = getResult(true) 23 | if not result is nothing then 24 | i = 1 25 | for each m in result 26 | ret = ret & "Match " & i & " '" & m.value & "' starts at index " & m.firstIndex & " with a length " & m.length & "
    " 27 | i = i + 1 28 | next 29 | page.returnValue "result", ret 30 | if result.count = 0 then 31 | page.returnValue "result", "No matches found." 32 | end if 33 | end if 34 | else 35 | result = getResult(false) 36 | page.returnValue "result", str(result) 37 | end if 38 | page.returnValue "err", regexError 39 | if page.RFHas("showCode") then 40 | code = "set rgx = new Regexp
    " & _ 41 | "rgx.pattern = """ & page.RFE("pattern") & """
    " & _ 42 | lib.iif(page.RFHas("ignorecase"), "rgx.ignoreCase = true
    ", "") & _ 43 | lib.iif(page.RFHas("global"), "rgx.global = true
    ", "") 44 | if page.RF("type") = "test" then 45 | code = code & "result = rgx.test(""" & page.RFE("searchstring") & """)
    " 46 | elseif page.RF("type") = "execute" then 47 | code = code & "set matches = rgx.execute(""" & page.RFE("searchstring") & """)
    " 48 | else 49 | code = code & "result = rgx.replace(""" & page.RFE("searchstring") & """, """ & page.RF("replaceby") & """)
    " 50 | end if 51 | page.returnValue "code", "Code used:
    " & code & "set rgx = nothing" 52 | end if 53 | end sub 54 | 55 | '****************************************************************************************** 56 | '* rExec 57 | '****************************************************************************************** 58 | function getResult(expectingObject) 59 | set r = new Regexp 60 | r.pattern = page.RF("pattern") 61 | r.ignoreCase = page.RFHas("ignorecase") 62 | r.global = page.RFHas("global") 63 | if expectingObject then set getResult = nothing 64 | on error resume next 65 | select case page.RF("type") 66 | case "test" 67 | if r.test(page.RF("searchstring")) then 68 | getResult = "Pattern found in search string." 69 | else 70 | getResult = "Pattern NOT found in search string." 71 | end if 72 | case "execute" 73 | set getResult = r.execute(page.RF("searchstring")) 74 | case "replace" 75 | getResult = r.replace(page.RF("searchstring"), page.RF("replaceby")) 76 | end select 77 | if err <> 0 then 78 | regexError = err.description 79 | if expectingObject then 80 | set getResult = nothing 81 | else 82 | getResult = "" 83 | end if 84 | end if 85 | on error goto 0 86 | end function 87 | 88 | '****************************************************************************************** 89 | '* content 90 | '****************************************************************************************** 91 | sub main() %> 92 | 93 | This helps you quickly build and test a regular expression using the VBScript Rexgexp object. 94 | Play around and tune your regular expression for the use within your ASP ajaxed web applications. 95 |

    96 | 97 |
    98 | 99 |
    100 | Pattern:
    101 |
    102 | larger 103 |
    104 | Regex Reference 105 |

    106 | 107 | 108 |
    109 | 110 | 111 |
    112 | 113 | 114 |

    115 | 116 | 117 |
    118 | 119 | 120 |
    121 | 122 | 123 | 124 | 125 |

    126 | 139 | 142 |
    143 |
    144 | Search string:
    145 |
    146 | larger 147 |

    148 |
    > Ready.
    149 | clear console 150 |
    151 |
     
    152 | 153 |
    154 | 155 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/source.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-04-08 21:38 6 | '* Description: documentation 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | set page = new AjaxedPage 11 | with page 12 | .plain = true 13 | .onlyDev = true 14 | .draw() 15 | end with 16 | set page = nothing 17 | 18 | '****************************************************************************************** 19 | '* main 20 | '****************************************************************************************** 21 | sub main() 22 | content() 23 | end sub 24 | 25 | '****************************************************************************************** 26 | '* content 27 | '****************************************************************************************** 28 | sub content() %> 29 | 30 | download current version 31 | the current stable version can be downloaded from the official site. 32 | 33 |

    34 | ajaxed SVN 35 | the source of ajaxed is controlled with SVN. Therefore it's possible that you 36 | always get the latest version (edge version) directly from the repository. Good 37 | if you want to grab the latest changes even before a release has been made. 38 | 39 |

    40 | How to get the latest version from SVN? 41 |
      42 |
    1. Download and install Tortoise SVN
    2. 43 |
    3. Right-mouse click in windows explorer on the folder you want to import ajaxed sources.
    4. 44 |
    5. Click "SVN Checkout..."
    6. 45 |
    7. Enter http://asp-ajaxed.googlecode.com/svn/trunk/ as URL of repository
    8. 46 |
    47 | 48 | Interested in development and contribution? 49 | Get in touch with Michal. He is always happy about new developers. 50 | 51 | <% end sub %> 52 | -------------------------------------------------------------------------------- /ajaxed/console/std.css: -------------------------------------------------------------------------------- 1 | * { 2 | font:11pt tahoma; 3 | } 4 | h1 { 5 | font:20pt georgia; 6 | margin:1em; 7 | } 8 | h2 { 9 | font:18pt georgia; 10 | margin-top:1.5em; 11 | } 12 | strong { 13 | font-weight:bold; 14 | } 15 | em { 16 | font-style:italic; 17 | } 18 | .ajaxLoadingIndicator { 19 | background-color: #cc0000; 20 | color: #fff; 21 | margin:2px; 22 | padding:2px; 23 | right: 0px; 24 | } 25 | .ct { 26 | text-align:center; 27 | } 28 | button { 29 | padding:0.1em 1em; 30 | } 31 | small, .small, .small *, small * { 32 | font-size:8pt; 33 | } 34 | .indent { 35 | margin-left:2em; 36 | } 37 | pre { 38 | margin:0px; 39 | } 40 | code { 41 | font-family:courier; 42 | color:#5B5B5B; 43 | } 44 | span.code, div.code { 45 | margin:1em; 46 | padding:1.5em; 47 | border:1px outset #000; 48 | } 49 | .code, .code * { 50 | font-family:courier; 51 | color:#000; 52 | background:#eee; 53 | } 54 | input.code, textarea.code { 55 | font-family:courier; 56 | background:#fff; 57 | } 58 | .comment { 59 | color:#008000; 60 | font-family:courier; 61 | } 62 | 63 | .console, .console * { 64 | font-family:courier; 65 | background:#000; 66 | color:#fff; 67 | } 68 | .console { 69 | border:2px inset #fff; 70 | padding:1em; 71 | height:150px; 72 | overflow:auto; 73 | } 74 | .console .error { 75 | background:#f00; 76 | } 77 | .console .info { 78 | color:#ff0; 79 | } 80 | 81 | .blue .top, 82 | .blue .top b, 83 | .blue .bottom, 84 | .blue .bottom b, 85 | .blue .content { 86 | color:#fff; 87 | background-color:#6FC7F7; 88 | border-color:#2662DF; 89 | } 90 | 91 | /* tabs from http://woork.blogspot.com/2008/03/clean-tab-bar-digg-like-using-css.html */ 92 | ul.tab, ul.tab li{border:0; margin:0; padding:0; list-style:none;} 93 | ul.tab{ 94 | border-bottom:solid 1px #DEDEDE; 95 | height:29px; 96 | padding-left:20px; 97 | cursor:pointer; 98 | } 99 | ul.tab li{float:left; margin-right:2px;} 100 | 101 | .tab a:link, .tab a:visited{ 102 | background:url(img/tab-round.png) right 60px; 103 | color:#666666; 104 | display:block; 105 | font-weight:bold; 106 | height:30px; 107 | line-height:30px; 108 | text-decoration:none; 109 | } 110 | .tab a span{ 111 | background:url(img/tab-round.png) left 60px; 112 | display:block; 113 | height:30px; 114 | margin-right:14px; 115 | padding-left:14px; 116 | } 117 | .tab a:hover{ 118 | background:url(img/tab-round.png) right 30px; 119 | display:block; 120 | } 121 | .tab a:hover span{ 122 | background:url(img/tab-round.png) left 30px; 123 | display:block; 124 | } 125 | 126 | /* -------------------------------- */ 127 | /* ACTIVE ELEMENTS */ 128 | .active a:link, .active a:visited, .active a:visited, .active a:hover{ 129 | background:url(img/tab-round.png) right 0 no-repeat; 130 | } 131 | .active a span, .active a:hover span{ 132 | background:url(img/tab-round.png) left 0 no-repeat; 133 | } -------------------------------------------------------------------------------- /ajaxed/console/templates.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | set page = new AjaxedPage 5 | with page 6 | .onlyDev = true 7 | .plain = true 8 | .draw() 9 | end with 10 | set page = nothing 11 | 12 | '****************************************************************************************** 13 | '* callback 14 | '****************************************************************************************** 15 | sub callback(action) 16 | set t = new TextTemplate 17 | t.fileName = page.RF("name") 18 | 19 | if action = "load" then 20 | page.returnValue "name", t.filename 21 | page.returnValue "content", t.content 22 | exit sub 23 | end if 24 | 25 | if not str.startsWith(t.filename, "/") or not str.endsWith(lCase(t.filename), ".template") then 26 | page.return "Template name must start with a '/' and has the extension '.template'" 27 | exit sub 28 | end if 29 | 30 | desc = "" 31 | select case action 32 | case "delete" 33 | on error resume next 34 | t.delete() 35 | desc = err.description 36 | on error goto 0 37 | page.return desc 38 | case "save" 39 | t.content = page.RF("template") 40 | on error resume next 41 | t.save() 42 | desc = err.description 43 | on error goto 0 44 | page.return desc 45 | end select 46 | end sub 47 | 48 | '****************************************************************************************** 49 | '* main 50 | '****************************************************************************************** 51 | sub main() %> 52 | 53 | 70 | 71 |
    72 | 73 | Templates listed here are used with the TextTemplate component. 74 | Best use for the templates is in combination with emails. It seperates email content from the actual code. 75 | Thus changing email content does not require touching the code anymore. 76 |

    77 | 78 |
    79 | Template: (virtual path & filename)
    80 |
    81 |
    82 | Template content:
    83 |
    84 |

    85 | 86 | 87 |
    88 |
    89 | Existing Templates: 90 |
    91 |
    92 |
    93 |
     
    94 | 95 |
    96 | 97 | <% page.execJS("loadList();") %> 98 | 99 | 100 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/templatesList.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-04-14 19:19 6 | '* Description: lists all templates on the server 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | numberTemplates = 0 11 | set page = new AjaxedPage 12 | with page 13 | .onlyDev = true 14 | .plain = true 15 | .draw() 16 | end with 17 | set page = nothing 18 | 19 | '****************************************************************************************** 20 | '* drawFiles 21 | '****************************************************************************************** 22 | function drawFiles(folder, caption) 23 | if lcase(folder.name) = "ajaxed" then exit function 24 | for each file in folder.files 25 | if str.endsWith(file.name, ".template") then 26 | path = unmapPath(file.path, "/") 27 | str.writeln(str.format(caption, array(path, str.shorten(file.name, 25, "...")))) 28 | numberTemplates = numberTemplates + 1 29 | end if 30 | next 31 | for each subfolder in folder.subfolders 32 | drawFiles subFolder, caption 33 | next 34 | end function 35 | 36 | '****************************************************************************************** 37 | '* unMapPath 38 | '****************************************************************************************** 39 | function unMapPath(aPath, virtualRoot) 40 | unMapPath = replace(replace(lCase(aPath), lCase(server.mappath(virtualRoot)), ""), "\", "/") 41 | end function 42 | 43 | '****************************************************************************************** 44 | '* main 45 | '****************************************************************************************** 46 | sub main() %> 47 | 48 | <% c = "{1}" %> 49 | <% drawFiles lib.fso.getFolder(server.mappath("/")), c %> 50 | 51 |

    52 | <%= numberTemplates %> templates found. 53 | 54 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/test_console.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | set tf = new TestFixture 4 | tf.run() 5 | 6 | sub test_1() 7 | pages = array( _ 8 | "default.asp", "console.js", _ 9 | "configuration.asp", "ajaxed version", _ 10 | "tests.asp", "run all", _ 11 | "documentation.asp", "generate...", _ 12 | "source.asp", "SVN", _ 13 | "templates.asp", "existing templates", _ 14 | "logs.asp", "clear all", _ 15 | "regex.asp", "pattern:" _ 16 | ) 17 | for i = 0 to uBound(pages) step 2 18 | page = "/ajaxed/console/" & pages(i) 19 | tf.assertResponse page, empty, pages(i + 1), page & " seem not to respond!" 20 | next 21 | end sub 22 | %> -------------------------------------------------------------------------------- /ajaxed/console/tests.asp: -------------------------------------------------------------------------------- 1 |  2 | <% 3 | '****************************************************************************************** 4 | '* Creator: michal 5 | '* Created on: 2008-04-08 21:33 6 | '* Description: lists all tests 7 | '* Input: - 8 | '****************************************************************************************** 9 | 10 | set page = new AjaxedPage 11 | with page 12 | .plain = true 13 | .onlyDev = true 14 | .draw() 15 | end with 16 | set page = nothing 17 | 18 | '****************************************************************************************** 19 | '* prints test files 20 | '* - the ajaxedFolder param is here because virtual folders are not recognized 21 | '* when walking through the FS with FSO. thats why it needs to be done manually. 22 | '* Its only done for the ajaxed folder because this is likely to be virtual on some 23 | '* environments. 24 | '****************************************************************************************** 25 | function drawFiles(folder, caption, ajaxedFolder) 26 | if lcase(folder.name) = "ajaxed" and not ajaxedFolder then exit function 27 | for each file in folder.files 28 | if str.startsWith(file.name, "test_") and str.endsWith(file.name, ".asp") then 29 | if ajaxedFolder then 30 | path = "/ajaxed" & unmapPath(file.path, "/ajaxed/") 31 | else 32 | path = unmapPath(file.path, "/") 33 | end if 34 | str.writeln(str.format(caption, array(path, str.shorten(file.name, 25, "...")))) 35 | end if 36 | next 37 | for each subfolder in folder.subfolders 38 | drawFiles subFolder, caption, ajaxedFolder 39 | next 40 | end function 41 | 42 | '****************************************************************************************** 43 | '* unMapPath 44 | '****************************************************************************************** 45 | function unMapPath(aPath, virtualRoot) 46 | unMapPath = replace(replace(lCase(aPath), lCase(server.mappath(virtualRoot)), ""), "\", "/") 47 | end function 48 | 49 | '****************************************************************************************** 50 | '* main 51 | '****************************************************************************************** 52 | sub main() 53 | content() 54 | end sub 55 | 56 | '****************************************************************************************** 57 | '* content 58 | '****************************************************************************************** 59 | sub content() %> 60 | 61 | 91 | 92 | Here you see all unit tests located on your server. A test is recognized if the file 93 | is prefixed with test_ and has the extension .asp. The console 94 | indicates test errors and failures with a red background color. 95 | Take a look at the documentation of the TestFixture class if you want to write 96 | your own tests. 97 |

    98 | 99 |
    100 |
    101 | <% 102 | link = " " & _ 103 | "{1}  " & _ 104 | "
    " 105 | %> 106 |
    107 | 108 | 109 | Ajaxed tests: 110 |
    111 | <% drawFiles lib.fso.getFolder(server.mappath("/ajaxed/")), link, true %> 112 |
    113 |
    114 |
    115 | 116 | 117 | Other tests: 118 |
    119 | <% drawFiles lib.fso.getFolder(server.mappath("/")), link, false %> 120 |
    121 |
    122 | 123 | 124 |
    125 |
    126 |
    127 |
    > Ready.
    128 |
    129 |
    130 | clear console 131 |
    132 |
     
    133 | 134 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/console/version.asp: -------------------------------------------------------------------------------- 1 |  2 | 3 | <% 4 | '****************************************************************************************** 5 | '* Creator: michal 6 | '* Created on: 2008-04-14 20:48 7 | '* Description: generates an RSS feed which populates the version of ajaxed 8 | '****************************************************************************************** 9 | 10 | set page = new AjaxedPage 11 | page.plain = true 12 | page.draw() 13 | 14 | sub main() 15 | set r = new RSS 16 | r.title = "ajaxed version feed" 17 | r.description = lib.version 18 | r.link = "http://www.ajaxed.org/ajaxed/console/version.asp" 19 | r.publishedDate = now() 20 | r.language = "en" 21 | r.generate("RSS2.0", empty).save(response) 22 | set r = nothing 23 | end sub 24 | %> -------------------------------------------------------------------------------- /ajaxed/demo/default.asp: -------------------------------------------------------------------------------- 1 | 2 | <% 3 | set page = new AjaxedPage 4 | with page 5 | .title = "ajaxed demo - classic asp library" 6 | .defaultStructure = true 7 | .draw() 8 | end with 9 | 10 | '****************************************************************************************** 11 | '* init 12 | '****************************************************************************************** 13 | sub init() 14 | delay = str.parse(page.RF("delay"), 0) 15 | if delay > 0 and delay < 5 then lib.sleep delay 16 | end sub 17 | 18 | '****************************************************************************************** 19 | '* callback - this is the function which will be processed when any ajaxed.callback 20 | '* javascript function is executed. The action is here to differentiate between 21 | '* all your ajaxed.callback functions in the page. 22 | '****************************************************************************************** 23 | sub callback(action) 24 | if action = "add" then 25 | 'str.parse is VERY handy function which converts a variable into 26 | 'the desired type. if it cannot be converted then the alternative value is returned 27 | page.return(str.parse(page.RF("a"), 0) + str.parse(page.RF("b"), 0)) 28 | 29 | 'see also page.returnValue - with this you can return even more values in one go 30 | 'e.g. a recordset with data and a boolean flag which indicates something else 31 | end if 32 | end sub 33 | 34 | '****************************************************************************************** 35 | '* header 36 | '****************************************************************************************** 37 | sub header() 38 | page.loadCSSFile "../console/std.css", empty 39 | end sub 40 | 41 | '****************************************************************************************** 42 | '* sub 43 | '****************************************************************************************** 44 | sub pagePart_one() %> 45 | 46 | here is some content of the page part one.
    47 | this HTML is simply located within a sub called "pagePart_one". 48 | Thats all you need ;) 49 | 50 | <% end sub %> 51 | 52 | <% sub pagePart_two() %> 53 | 54 | and here is another part. Check the source code to see how it works!
    55 | This could be some tabs in an application ... maybe. ajaxed rocks on asp :) 56 | 57 | <% end sub %> 58 | 59 | <% sub main() %> 60 | 61 | 67 | 68 | 73 | 74 |

    ajaxed v<%= lib.version %> Demo

    75 | 76 |
    77 |
    78 | 1. Calling a server side procedure 79 |

    80 | Test ajaxed functionality by adding up two number on server side using AJAX. 81 | Enter two numbers and press calculate to get the total. You will see that 82 | the page is not reloaded. Also recognize the "loading" indicator at the top right of the page. 83 |

    84 | 85 | + 86 | = 87 | 88 | 89 | 90 |

    91 | 2. Using page parts 92 |

    93 | Ajaxed also supports loading whole HTML fragments. This functionality is called "page parts". Page parts 94 | are simply sub's in your code which return HTML. This markup is then inserted automatically into a container 95 | of your choice. See a simple example: 96 |

    97 | 98 | Part one 99 |    100 | Part two 101 |
    102 |
    103 | 104 |

    105 | You dont see the loading indicator? Set some seconds delay for the calculation: 106 | seconds (1-5) 107 |
    108 | 109 |
    110 | Take also a look at the ajaxed developer console 111 | ajaxed console which supports you while you develop. 112 | 113 |

    114 | asp ajaxed 115 | 116 | 117 | 118 | <% end sub %> -------------------------------------------------------------------------------- /ajaxed/developer.txt: -------------------------------------------------------------------------------- 1 | ajaxed library 2 | 3 | 1. do changes (dont remove any public interfaces) 4 | 2. comment all public interfaces 5 | 3. add test to the test/test.asp 6 | 4. run tests 7 | 5. add the changes to changes.txt 8 | 6. Update the documentation index.html in the root 9 | 7. increase version if necessary (lib.version) -------------------------------------------------------------------------------- /ajaxed/installation.txt: -------------------------------------------------------------------------------- 1 | AJAXED 2 | 3 | 1. copy the whole folder (ajaxed) into your web root 4 | 2. open http://yourserver.com/ajaxed/demo/ to check if everything works 5 | OPTIONAL: check the /ajaxedConfig/config.asp to perform any conifgurations 6 | OPTIONAL: check http://yourserver.com/ajaxed/index.html for the documentation 7 | OPTIONAL: go to http://yourserver.com/ajaxed/console to see the ajaxed console 8 | OPTIONAL: you can set the style of the loading indicator by defining a css class called "ajaxLoadingIndicator" 9 | OPTIONAL: you may want to delete the "test" and "demo" folder if you dont want to have them in your production environment 10 | 11 | IMPORTANT NOTE: in order that special chars and german umlaute work fine you need to save your files with UTF-8 encoding!! 12 | 13 | HAVE FUN! 14 | 15 | for updates, suggestions, bug reports 16 | http://www.ajaxed.org -------------------------------------------------------------------------------- /ajaxed/license.txt: -------------------------------------------------------------------------------- 1 | Licensed under the Lesser GNU (LGPL) open source license version 2.1. 2 | 3 | Copyright 2007 Michal Gabrukiewicz 4 | All rights reserved. 5 | 6 | This library is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 9 | Lesser General Public License for more details. 10 | 11 | -------------------------------------------------------------------------------- /ajaxed/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/logo.png -------------------------------------------------------------------------------- /ajaxed/poweredby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASP-Ajaxed/asp-ajaxed/8757adc449e1a302f29a62c1787e12f728cb4651/ajaxed/poweredby.png -------------------------------------------------------------------------------- /ajaxed/script.aculo.us/builder.js: -------------------------------------------------------------------------------- 1 | // script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 2 | 3 | // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 4 | // 5 | // script.aculo.us is freely distributable under the terms of an MIT-style license. 6 | // For details, see the script.aculo.us web site: http://script.aculo.us/ 7 | 8 | var Builder = { 9 | NODEMAP: { 10 | AREA: 'map', 11 | CAPTION: 'table', 12 | COL: 'table', 13 | COLGROUP: 'table', 14 | LEGEND: 'fieldset', 15 | OPTGROUP: 'select', 16 | OPTION: 'select', 17 | PARAM: 'object', 18 | TBODY: 'table', 19 | TD: 'table', 20 | TFOOT: 'table', 21 | TH: 'table', 22 | THEAD: 'table', 23 | TR: 'table' 24 | }, 25 | // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, 26 | // due to a Firefox bug 27 | node: function(elementName) { 28 | elementName = elementName.toUpperCase(); 29 | 30 | // try innerHTML approach 31 | var parentTag = this.NODEMAP[elementName] || 'div'; 32 | var parentElement = document.createElement(parentTag); 33 | try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 34 | parentElement.innerHTML = "<" + elementName + ">"; 35 | } catch(e) {} 36 | var element = parentElement.firstChild || null; 37 | 38 | // see if browser added wrapping tags 39 | if(element && (element.tagName.toUpperCase() != elementName)) 40 | element = element.getElementsByTagName(elementName)[0]; 41 | 42 | // fallback to createElement approach 43 | if(!element) element = document.createElement(elementName); 44 | 45 | // abort if nothing could be created 46 | if(!element) return; 47 | 48 | // attributes (or text) 49 | if(arguments[1]) 50 | if(this._isStringOrNumber(arguments[1]) || 51 | (arguments[1] instanceof Array) || 52 | arguments[1].tagName) { 53 | this._children(element, arguments[1]); 54 | } else { 55 | var attrs = this._attributes(arguments[1]); 56 | if(attrs.length) { 57 | try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 58 | parentElement.innerHTML = "<" +elementName + " " + 59 | attrs + ">"; 60 | } catch(e) {} 61 | element = parentElement.firstChild || null; 62 | // workaround firefox 1.0.X bug 63 | if(!element) { 64 | element = document.createElement(elementName); 65 | for(attr in arguments[1]) 66 | element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; 67 | } 68 | if(element.tagName.toUpperCase() != elementName) 69 | element = parentElement.getElementsByTagName(elementName)[0]; 70 | } 71 | } 72 | 73 | // text, or array of children 74 | if(arguments[2]) 75 | this._children(element, arguments[2]); 76 | 77 | return element; 78 | }, 79 | _text: function(text) { 80 | return document.createTextNode(text); 81 | }, 82 | 83 | ATTR_MAP: { 84 | 'className': 'class', 85 | 'htmlFor': 'for' 86 | }, 87 | 88 | _attributes: function(attributes) { 89 | var attrs = []; 90 | for(attribute in attributes) 91 | attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + 92 | '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); 93 | return attrs.join(" "); 94 | }, 95 | _children: function(element, children) { 96 | if(children.tagName) { 97 | element.appendChild(children); 98 | return; 99 | } 100 | if(typeof children=='object') { // array can hold nodes and text 101 | children.flatten().each( function(e) { 102 | if(typeof e=='object') 103 | element.appendChild(e) 104 | else 105 | if(Builder._isStringOrNumber(e)) 106 | element.appendChild(Builder._text(e)); 107 | }); 108 | } else 109 | if(Builder._isStringOrNumber(children)) 110 | element.appendChild(Builder._text(children)); 111 | }, 112 | _isStringOrNumber: function(param) { 113 | return(typeof param=='string' || typeof param=='number'); 114 | }, 115 | build: function(html) { 116 | var element = this.node('div'); 117 | $(element).update(html.strip()); 118 | return element.down(); 119 | }, 120 | dump: function(scope) { 121 | if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope 122 | 123 | var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + 124 | "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + 125 | "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ 126 | "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ 127 | "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ 128 | "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); 129 | 130 | tags.each( function(tag){ 131 | scope[tag] = function() { 132 | return Builder.node.apply(Builder, [tag].concat($A(arguments))); 133 | } 134 | }); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /ajaxed/script.aculo.us/scriptaculous.js: -------------------------------------------------------------------------------- 1 | // script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 2 | 3 | // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining 6 | // a copy of this software and associated documentation files (the 7 | // "Software"), to deal in the Software without restriction, including 8 | // without limitation the rights to use, copy, modify, merge, publish, 9 | // distribute, sublicense, and/or sell copies of the Software, and to 10 | // permit persons to whom the Software is furnished to do so, subject to 11 | // the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | // 24 | // For details, see the script.aculo.us web site: http://script.aculo.us/ 25 | 26 | var Scriptaculous = { 27 | Version: '1.8.1', 28 | require: function(libraryName) { 29 | // inserting via DOM fails in Safari 2.0, so brute force approach 30 | document.write('