diff --git a/contrib/library/network/server/nino/.gitignore b/contrib/library/network/server/nino/.gitignore new file mode 100644 index 00000000..6342e5c2 --- /dev/null +++ b/contrib/library/network/server/nino/.gitignore @@ -0,0 +1 @@ +EIFGENs diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/application.e b/contrib/library/network/server/nino/example/SimpleWebServer/application.e new file mode 100644 index 00000000..51666fd4 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/application.e @@ -0,0 +1,44 @@ +note + description : "nino application root class" + date : "$Date$" + revision : "$Revision$" + +class + APPLICATION + +inherit + ARGUMENTS + + HTTP_SERVER_SHARED_CONFIGURATION + +create + make + +feature {NONE} -- Initialization + + make + -- Run application. + local + l_server : HTTP_SERVER + l_cfg: HTTP_SERVER_CONFIGURATION + l_http_handler : HTTP_HANDLER + do + create l_cfg.make + l_cfg.http_server_port := 9_000 + l_cfg.document_root := default_document_root + set_server_configuration (l_cfg) + debug ("nino") + l_cfg.set_is_verbose (True) + end + + create l_server.make (l_cfg) + create {APPLICATION_CONNECTION_HANDLER} l_http_handler.make (l_server) + l_server.setup (l_http_handler) + end + +feature -- Access + + default_document_root: STRING = "webroot" + +end + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/application_connection_handler.e b/contrib/library/network/server/nino/example/SimpleWebServer/application_connection_handler.e new file mode 100644 index 00000000..87833f7d --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/application_connection_handler.e @@ -0,0 +1,61 @@ +note + description: "Summary description for {HTTP_CONNECTION_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + APPLICATION_CONNECTION_HANDLER + +inherit + HTTP_CONNECTION_HANDLER + +create + make + +feature -- Request processing + + process_request (a_handler: HTTP_CONNECTION_HANDLER; a_socket: TCP_STREAM_SOCKET) + -- Process request ... + local + a_method: STRING + do + a_method := a_handler.method + + if a_method.is_equal (Get) then + execute_get_request (a_handler.uri, a_handler.request_header_map, a_handler.request_header, a_socket) + elseif a_method.is_equal (Post) then + execute_post_request (a_handler.uri, a_handler.request_header_map, a_handler.request_header, a_socket) + elseif a_method.is_equal (Put) then + elseif a_method.is_equal (Options) then + elseif a_method.is_equal (Head) then + elseif a_method.is_equal (Delete) then + elseif a_method.is_equal (Trace) then + elseif a_method.is_equal (Connect) then + else + debug + print ("Method [" + a_method + "] not supported") + end + end + end + + execute_get_request (a_uri: STRING; a_headers_map: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_socket: TCP_STREAM_SOCKET) + local + l_http_request : HTTP_REQUEST_HANDLER + do + create {GET_REQUEST_HANDLER} l_http_request.make (a_socket) + l_http_request.set_uri (a_uri) + l_http_request.process + end + + execute_post_request (a_uri: STRING; a_headers_map: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_socket: TCP_STREAM_SOCKET) + local + l_http_request : HTTP_REQUEST_HANDLER + do + check not_yet_implemented: False end + create {POST_REQUEST_HANDLER} l_http_request.make (a_socket) + l_http_request.set_uri (a_uri) + l_http_request.process + end + +end diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/http_server_shared_configuration.e b/contrib/library/network/server/nino/example/SimpleWebServer/http_server_shared_configuration.e new file mode 100644 index 00000000..7ffca95e --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/http_server_shared_configuration.e @@ -0,0 +1,48 @@ +note + description: "Summary description for {HTTP_SERVER_SHARED_CONFIGURATION}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + HTTP_SERVER_SHARED_CONFIGURATION + +feature -- Access + + server_configuration: detachable HTTP_SERVER_CONFIGURATION + -- Shared configuration + do + if attached server_configuration_cell.item as l_cfg then + Result := l_cfg + end + end + + document_root: STRING_8 + -- Shared document root + do + if attached server_configuration as l_cfg then + Result := l_cfg.document_root + else + Result := "" + end + end + +feature -- Element change + + set_server_configuration (a_cfg: like server_configuration) + -- Set `server_configuration' to `a_cfg'. + do + server_configuration_cell.replace (a_cfg) + end + +feature {NONE} -- Implementation + + server_configuration_cell: CELL [detachable HTTP_SERVER_CONFIGURATION] + once ("PROCESS") + create Result.put (Void) + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/request/get_request_handler.e b/contrib/library/network/server/nino/example/SimpleWebServer/request/get_request_handler.e new file mode 100644 index 00000000..eb7f8543 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/request/get_request_handler.e @@ -0,0 +1,172 @@ +class + GET_REQUEST_HANDLER + +inherit + HTTP_REQUEST_HANDLER + + HTTP_SERVER_SHARED_CONFIGURATION + undefine + default_create + end + + SHARED_URI_CONTENTS_TYPES + undefine + default_create + end + + HTTP_CONSTANTS + undefine + default_create + end + +create + make + +feature {NONE} -- Initialization + + make (a_socket: TCP_STREAM_SOCKET) + do + default_create + socket := a_socket + end + +feature -- Access + + socket: TCP_STREAM_SOCKET + +feature -- Execution + + process + -- process the request and create an answer + local + fname: STRING_8 + f: RAW_FILE + ctype, extension: detachable STRING_8 + do + answer.reset + if script_name.is_equal ("/") then + process_default + answer.set_content_type ("text/html") + else + create fname.make_from_string (Document_root) + fname.append (script_name) + debug + print ("URI filename: " + fname) + end + create f.make (real_filename (fname)) + if f.exists then + extension := Ct_table.extension (script_name) + ctype := Ct_table.content_types.item (extension) + if f.is_directory then + process_directory (f) + else + if ctype = Void then + process_raw_file (f) + answer.set_content_type ("text/html") + else + if ctype.is_equal ("text/html") then + process_text_file (f) + else + process_raw_file (f) + end + answer.set_content_type (ctype) + end + end + else + answer.set_status_code (Not_found) + answer.set_reason_phrase (Not_found_message) + answer.set_reply_text ("Not found on this server") + end + end + if attached answer.reply_text as t then + answer.set_content_length (t.count) + else + answer.set_content_length (0) + end + + --| Output the result + socket.put_string (answer.reply_header + answer.reply_text) + end + + process_default + -- Return a default response + local + html: STRING_8 + do + answer.set_reply_text ("") + html := " NINO HTTPD " + " " + " " + "

Welcome to NINO HTTPD!

" + "

Default page " + "

" + " " + " " + answer.append_reply_text (html) + end + + process_text_file (f: FILE) + -- send a text file reply + require + valid_f: f /= Void + do + f.open_read + from + answer.set_reply_text ("") + f.read_line + until + f.end_of_file + loop + answer.append_reply_text (f.last_string) + answer.append_reply_text (Crlf) + f.read_line + end + f.close + end + + process_raw_file (f: FILE) + -- send a raw file reply + require + valid_f: f /= Void + do + f.open_read + from + answer.set_reply_text ("") + until + f.end_of_file + loop + f.read_stream_thread_aware (1024) + answer.append_reply_text (f.last_string) + end + f.close + end + + process_directory (f: FILE) + --read the directory + require + is_directory: f.is_directory + local + l_dir: DIRECTORY + files: ARRAYED_LIST [STRING_8] + html1: STRING_8 + html2: STRING_8 + htmldir: STRING_8 + path: STRING_8 + do + answer.set_reply_text ("") + html1 := " NINO HTTPD " + " " + " " + "

Welcome to NINO HTTPD!

" + "

Default page " + html2 := "

" + " " + " " + path := script_name + if path[path.count] = '/' then + path.remove_tail (1) + end + create l_dir.make_open_read (f.name) + files := l_dir.linear_representation + from + files.start + htmldir := "" + answer.append_reply_text (html1 + htmldir + html2) + end + +end -- class GET_REQUEST_HANDLER + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/request/head_request_handler.e b/contrib/library/network/server/nino/example/SimpleWebServer/request/head_request_handler.e new file mode 100644 index 00000000..bf0cdd54 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/request/head_request_handler.e @@ -0,0 +1,115 @@ +note + description: "Summary description for {HEAD_REQUEST_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + HEAD_REQUEST_HANDLER + +inherit + + SHARED_DOCUMENT_ROOT + + SHARED_URI_CONTENTS_TYPES + + HTTP_REQUEST_HANDLER + + HTTP_CONSTANTS + +feature + + + process + -- process the request and create an answer + local + fname: STRING + f: RAW_FILE + ctype, extension: STRING + do + fname := document_root_cell.item.twin + fname.append (request_uri) + debug + print ("URI name: " + fname ) + end + create f.make (fname) + create answer.make + if f.exists then + extension := ct_table.extension (request_uri) + ctype := ct_table.content_types.item (extension) + -- TODO: This code could be improved to avoid string + -- comparisons + if ctype = Void then + process_default + answer.set_content_type ("text/html") + else + if ctype.is_equal ("text/html") then + process_text_file (f) + else + process_raw_file (f) + end + answer.set_content_type (ctype) + end + else + answer.set_status_code (not_found) + answer.set_reason_phrase (not_found_message) + answer.set_reply_text ("Not found on this server%N%R") + end + end + + process_default + -- + local + html : STRING + do + answer.set_reply_text ("") + html := " Micro HTTPD " + + " " + + " " + + "

Welcome to Micro HTTPD!

"+ + "

Default page " + + + "

" + + " " + + " " + answer.append_reply_text (html) + end + + + process_text_file (f: FILE) + -- send a text file reply + require + valid_f: f /= Void + do + f.open_read + from + answer.set_reply_text ("") + f.read_line + until f.end_of_file + loop + answer.append_reply_text (f.last_string) + answer.append_reply_text (crlf) + f.read_line + end + f.close + end + + process_raw_file (f: FILE) + -- send a raw file reply + require + valid_f: f /= Void + do + -- this is not quite right.... + f.open_read + from + answer.set_reply_text ("") + until f.end_of_file + loop + f.read_stream (1024) + answer.append_reply_text (f.last_string) + end + f.close + end + + +end diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/request/post_request_handler.e b/contrib/library/network/server/nino/example/SimpleWebServer/request/post_request_handler.e new file mode 100644 index 00000000..478660eb --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/request/post_request_handler.e @@ -0,0 +1,53 @@ +note + description: "Summary description for {POST_REQUEST_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + POST_REQUEST_HANDLER + +inherit + GET_REQUEST_HANDLER + redefine + process + end + +create + make + +feature -- Execution + + process + -- process the request and create an answer + local + l_data: STRING + s: detachable STRING + n: INTEGER + sock: like socket + do + from + n := 1_024 + sock := socket + if sock.socket_ok then + sock.read_stream_thread_aware (n) + s := sock.last_string + else + s := Void + end + create l_data.make_empty + until + s = Void or else s.count < n + loop + l_data.append_string (s) + if sock.socket_ok then + sock.read_stream_thread_aware (n) + s := sock.last_string + else + s := Void + end + end + Precursor + end + +end diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/web_server-safe.ecf b/contrib/library/network/server/nino/example/SimpleWebServer/web_server-safe.ecf new file mode 100644 index 00000000..7b14b1cd --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/web_server-safe.ecf @@ -0,0 +1,22 @@ + + + + + + /.git$ + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/web_server.ecf b/contrib/library/network/server/nino/example/SimpleWebServer/web_server.ecf new file mode 100644 index 00000000..af99531c --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/web_server.ecf @@ -0,0 +1,21 @@ + + + + + + /.git$ + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/img/gradient_light.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/img/gradient_light.jpg new file mode 100644 index 00000000..4e50da05 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/img/gradient_light.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/changes.txt b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/changes.txt new file mode 100644 index 00000000..4b2933f6 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/changes.txt @@ -0,0 +1,91 @@ +1.4.2 +[Feature] +- The plugin support percentages as target ('50%' or {top:'50%', left:'45%'}) +- Exposed the max() calculation as $.scrollTo.max +[Enhancement] +- Renamed $.fn.scrollable to $.fn._scrollable to avoid conflicts with other plugins +[Fix] +- Fixing max calculations for regular DOM elements + +1.4.1 +[Feature] +- The target can be 'max' to scroll to the end while keeping it elegant. +[Enhancement] +- Default duration is 0 for jquery +1.3. Means sync animation +- The plugin works on all major browsers, on compat & quirks modes, including iframes. +- In addition to window/document, if html or body are received, the plugin will choose the right one. +[Fix] +- The plugin accepts floating numbers, Thanks Ramin +- Using jQuery.nodeName where neccessary so that this works on xml+xhtml +- The max() internal function wasn't completely accurrate, now it is 98% (except for IE on quirks mode and it's not too noticeable). + +1.4 +[Fix] +- Fixed the problem when scrolling the window to absolute positioned elements on Safari. +- Fixed the problem on Opera 9.5 when scrolling the window. That it always scrolls to 0. +[Feature] +- Added the settings object as 2nd argument to the onAfter callback. +- The 3rd argument of scrollTo can be just a function and it's used as the onAfter. +- Added full support for iframes (even max scroll calculation). +- Instead of $.scrollTo, $(window).scrollTo() and $(document).scrollTo() can be used. +- Added $().scrollable() that returns the real element to scroll, f.e: $(window).scrollable() == [body|html], works for iframes. +[Enhancement] +- Cleaned the code a bit, specially the comments + +1.3.3 +[Change] +- Changed the licensing from GPL to GPL+MIT. + +1.3.2 +[Enhancement] +- Small improvements to make the code shorter. +[Change] +- Removed the last argument received by onAfter as it was the same as the 'this' but jqueryfied. + +1.3.1 +[Feature] +- Exposed $.scrollTo.window() to get the element that needs to be animated, to scroll the window. +- Added option 'over'. +[Enhancement] +- Made the code as short as possible. +[Change] +- Changed the arguments received by onAfter + +1.3 +[Enhancement] +- Added semicolon to the start, for safe file concatenation +- Added a limit check, values below 0 or over the maximum are fixed. +- Now it should work faster, only one of html or body go through all the processing, instead of both for all browsers. +[Fix] +- Fixed the behavior for Opera, which seemed to react to both changes on and . +- The border is also reduced, when 'margin' is set to true. +[Change] +- The option speed has been renamed to duration. +[Feature] +- The duration can be specified with a number as 2nd argument, and the rest of the settings as the third ( like $().animate ) +- Remade the demo + +1.2.4 +[Enhancement] +- The target can be in the form of { top:x, left:y } allowing different position for each axis. +[Feature] +- The option 'offset' has been added, to scroll behind or past the target. Can be a number(both axes) or { top:x, left:y }. + +1.2.3 +[Feature] +- Exposed the defaults. +[Enhancement] +- Made the callback functions receive more parameters. + +1.2.2 +[Fix] +- Fixed a bug, I didn't have to add the scrolled amount if it was body or html. + +1.2 +[Change] +- The option 'onafter' is now called 'onAfter'. +[Feature] +- Two axes can be scrolled together, this is set with the option 'axis'. +- In case 2 axes are chosen, the scrolling can be queued: one scrolls, and then the other. +- There's an intermediary event, 'onAfterFirst' called in case the axes are queued, after the first ends. +- If the option 'margin' is set to true, the plugin will take in account, the margin of the target(no use if target is a value). \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo-min.js b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo-min.js new file mode 100644 index 00000000..73a33418 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo-min.js @@ -0,0 +1,11 @@ +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 5/25/2009 + * @author Ariel Flesler + * @version 1.4.2 + * + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + */ +;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo.js b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo.js new file mode 100644 index 00000000..eec31e19 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/jquery.scrollTo-1.4.2/jquery.scrollTo.js @@ -0,0 +1,215 @@ +/** + * jQuery.ScrollTo + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 5/25/2009 + * + * @projectDescription Easy element scrolling using jQuery. + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP. + * + * @author Ariel Flesler + * @version 1.4.2 + * + * @id jQuery.scrollTo + * @id jQuery.fn.scrollTo + * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements. + * The different options for target are: + * - A number position (will be applied to all axes). + * - A string position ('44', '100px', '+=90', etc ) will be applied to all axes + * - A jQuery/DOM element ( logically, child of the element to scroll ) + * - A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc ) + * - A hash { top:x, left:y }, x and y can be any kind of number/string like above. +* - A percentage of the container's dimension/s, for example: 50% to go to the middle. + * - The string 'max' for go-to-end. + * @param {Number} duration The OVERALL length of the animation, this argument can be the settings object instead. + * @param {Object,Function} settings Optional set of settings or the onAfter callback. + * @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'. + * @option {Number} duration The OVERALL length of the animation. + * @option {String} easing The easing method for the animation. + * @option {Boolean} margin If true, the margin of the target element will be deducted from the final position. + * @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }. + * @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes. + * @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends. + * @option {Function} onAfter Function to be called after the scrolling ends. + * @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends. + * @return {jQuery} Returns the same jQuery object, for chaining. + * + * @desc Scroll to a fixed position + * @example $('div').scrollTo( 340 ); + * + * @desc Scroll relatively to the actual position + * @example $('div').scrollTo( '+=340px', { axis:'y' } ); + * + * @dec Scroll using a selector (relative to the scrolled element) + * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } ); + * + * @ Scroll to a DOM element (same for jQuery object) + * @example var second_child = document.getElementById('container').firstChild.nextSibling; + * $('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){ + * alert('scrolled!!'); + * }}); + * + * @desc Scroll on both axes, to different values + * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } ); + */ +;(function( $ ){ + + var $scrollTo = $.scrollTo = function( target, duration, settings ){ + $(window).scrollTo( target, duration, settings ); + }; + + $scrollTo.defaults = { + axis:'xy', + duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1 + }; + + // Returns the element that needs to be animated to scroll the window. + // Kept for backwards compatibility (specially for localScroll & serialScroll) + $scrollTo.window = function( scope ){ + return $(window)._scrollable(); + }; + + // Hack, hack, hack :) + // Returns the real elements to scroll (supports window/iframes, documents and regular nodes) + $.fn._scrollable = function(){ + return this.map(function(){ + var elem = this, + isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1; + + if( !isWin ) + return elem; + + var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem; + + return $.browser.safari || doc.compatMode == 'BackCompat' ? + doc.body : + doc.documentElement; + }); + }; + + $.fn.scrollTo = function( target, duration, settings ){ + if( typeof duration == 'object' ){ + settings = duration; + duration = 0; + } + if( typeof settings == 'function' ) + settings = { onAfter:settings }; + + if( target == 'max' ) + target = 9e9; + + settings = $.extend( {}, $scrollTo.defaults, settings ); + // Speed is still recognized for backwards compatibility + duration = duration || settings.speed || settings.duration; + // Make sure the settings are given right + settings.queue = settings.queue && settings.axis.length > 1; + + if( settings.queue ) + // Let's keep the overall duration + duration /= 2; + settings.offset = both( settings.offset ); + settings.over = both( settings.over ); + + return this._scrollable().each(function(){ + var elem = this, + $elem = $(elem), + targ = target, toff, attr = {}, + win = $elem.is('html,body'); + + switch( typeof targ ){ + // A number will pass the regex + case 'number': + case 'string': + if( /^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ) ){ + targ = both( targ ); + // We are done + break; + } + // Relative selector, no break! + targ = $(targ,this); + case 'object': + // DOMElement / jQuery + if( targ.is || targ.style ) + // Get the real position of the target + toff = (targ = $(targ)).offset(); + } + $.each( settings.axis.split(''), function( i, axis ){ + var Pos = axis == 'x' ? 'Left' : 'Top', + pos = Pos.toLowerCase(), + key = 'scroll' + Pos, + old = elem[key], + max = $scrollTo.max(elem, axis); + + if( toff ){// jQuery / DOMElement + attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] ); + + // If it's a dom element, reduce the margin + if( settings.margin ){ + attr[key] -= parseInt(targ.css('margin'+Pos)) || 0; + attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0; + } + + attr[key] += settings.offset[pos] || 0; + + if( settings.over[pos] ) + // Scroll to a fraction of its width/height + attr[key] += targ[axis=='x'?'width':'height']() * settings.over[pos]; + }else{ + var val = targ[pos]; + // Handle percentage values + attr[key] = val.slice && val.slice(-1) == '%' ? + parseFloat(val) / 100 * max + : val; + } + + // Number or 'number' + if( /^\d+$/.test(attr[key]) ) + // Check the limits + attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max ); + + // Queueing axes + if( !i && settings.queue ){ + // Don't waste time animating, if there's no need. + if( old != attr[key] ) + // Intermediate animation + animate( settings.onAfterFirst ); + // Don't animate this axis again in the next iteration. + delete attr[key]; + } + }); + + animate( settings.onAfter ); + + function animate( callback ){ + $elem.animate( attr, duration, settings.easing, callback && function(){ + callback.call(this, target, settings); + }); + }; + + }).end(); + }; + + // Max scrolling position, works on quirks mode + // It only fails (not too badly) on IE, quirks mode. + $scrollTo.max = function( elem, axis ){ + var Dim = axis == 'x' ? 'Width' : 'Height', + scroll = 'scroll'+Dim; + + if( !$(elem).is('html,body') ) + return elem[scroll] - $(elem)[Dim.toLowerCase()](); + + var size = 'client' + Dim, + html = elem.ownerDocument.documentElement, + body = elem.ownerDocument.body; + + return Math.max( html[scroll], body[scroll] ) + - Math.min( html[size] , body[size] ); + + }; + + function both( val ){ + return typeof val == 'object' ? val : { top:val, left:val }; + }; + +})( jQuery ); \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/script.js b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/script.js new file mode 100644 index 00000000..55571713 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/script.js @@ -0,0 +1,12 @@ +$(document).ready(function(){ + /* This code is executed after the DOM has been completely loaded */ + + $('nav a,footer a.up').click(function(e){ + + // If a link has been clicked, scroll the page to the link's hash target: + + $.scrollTo( this.hash || 0, 1500); + e.preventDefault(); + }); + +}); \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/styles.css b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/styles.css new file mode 100644 index 00000000..ee4db145 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/styles.css @@ -0,0 +1,219 @@ +*{ + /* Universal reset: */ + margin:0; + padding:0; +} + +header,footer, +article,section, +hgroup,nav, +figure{ + /* Giving a display value to the HTML5 rendered elements: */ + display:block; +} + +body{ + /* Setting the default text color, size, page background and a font stack: */ + font-size:0.825em; + color:#fcfcfc; + background-color:#355664; + font-family:Arial, Helvetica, sans-serif; +} + +/* Hyperlink Styles: */ + +a, a:visited { + color:#0196e3; + text-decoration:none; + outline:none; +} + +a:hover{ + text-decoration:underline; +} + +a img{ + border:none; +} + +/* Headings: */ + +h1,h2,h3{ + font-family:"Myriad Pro","Helvetica Neue",Helvetica,Arial,Sans-Serif; + text-shadow:0 1px 1px black; +} + +h1{ + /* The logo text */ + font-size:3.5em; + padding:0.5em 0 0; + text-transform:uppercase; +} + +h3{ + /* The slogan text */ + font-family:forte,"Myriad Pro","Helvetica Neue",Helvetica,Arial,Sans-Serif; + font-size:2em; + font-weight:normal; + margin:0 0 1em; +} + + +h2{ + font-size:2.2em; + font-weight:normal; + letter-spacing:0.01em; + text-transform:uppercase; +} + +p{ + line-height:1.5em; + padding-bottom:1em; +} + +.line{ + /* The dividing line: */ + height:1px; + background-color:#24404c; + border-bottom:1px solid #416371; + margin:1em 0; + overflow:hidden; +} + +article .line{ + /* The dividing line inside of the article is darker: */ + background-color:#15242a; + border-bottom-color:#204656; + margin:1.3em 0; +} + +footer .line{ + margin:2em 0; +} + +nav{ + background:url(img/gradient_light.jpg) repeat-x 50% 50% #f8f8f8; + padding:0 5px; + position:absolute; + right:0; + top:4em; + + border:1px solid #FCFCFC; + + -moz-box-shadow:0 1px 1px #333333; + -webkit-box-shadow:0 1px 1px #333333; + box-shadow:0 1px 1px #333333; +} + +/* The clearfix hack to clear the floats: */ + +.clear:after{ + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +/* The navigation styling: */ + +nav ul li{ + display:inline; +} + +nav ul li a, +nav ul li a:visited{ + color:#565656; + display:block; + float:left; + font-size:1.25em; + font-weight:bold; + margin:5px 2px; + padding:7px 10px 4px; + text-shadow:0 1px 1px white; + text-transform:uppercase; +} + +nav ul li a:hover{ + text-decoration:none; + background-color:#f0f0f0; +} + +nav, article, nav ul li a,figure{ + /* Applying CSS3 rounded corners: */ + -moz-border-radius:10px; + -webkit-border-radius:10px; + border-radius:10px; +} + +/* Article styles: */ + +#page{ + width:960px; + margin:0 auto; + position:relative; +} + +article{ + background-color:#213E4A; + margin:3em 0; + padding:20px; + + text-shadow:0 2px 0 black; +} + +figure{ + border:3px solid #142830; + float:right; + height:300px; + margin-left:15px; + overflow:hidden; + width:500px; +} + +figure:hover{ + -moz-box-shadow:0 0 2px #4D7788; + -webkit-box-shadow:0 0 2px #4D7788; + box-shadow:0 0 2px #4D7788; +} + +figure img{ + margin-left:-60px; +} + +/* Footer styling: */ + +footer{ + margin-bottom:30px; + text-align:center; + font-size:0.825em; +} + + +footer p{ + margin-bottom:-2.5em; + position:relative; +} + +footer a,footer a:visited{ + color:#cccccc; + background-color:#213e4a; + display:block; + padding:2px 4px; + z-index:100; + position:relative; +} + +footer a:hover{ + text-decoration:none; + background-color:#142830; +} + +footer a.by{ + float:left; + +} + +footer a.up{ + float:right; +} diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/template.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/template.html new file mode 100644 index 00000000..cde688dc --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo1/template.html @@ -0,0 +1,139 @@ + + + + + + + Coding A CSS3 & HTML5 One Page Template | Tutorialzine demo + + + + + + + + + + + +
+ +
+ +
+

Your Logo

+

and a fancy slogan

+
+ + + +
+ +
+ + + +
+ +
+

Photoshoot Effect

+ +
+ +
+ +
+ +
+ +

In this tutorial, we are creating a photo shoot effect with our just-released PhotoShoot jQuery plug-in. With it you can convert a regular div on the page into a photo shooting stage simulating a camera-like feel.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer luctus quam quis nibh fringilla sit amet consectetur lectus malesuada. Sed nec libero erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mi nisi, rhoncus ut vestibulum ac, sollicitudin quis lorem. Duis felis dui, vulputate nec adipiscing nec, interdum vel tortor. Sed gravida, erat nec rutrum tincidunt, metus mauris imperdiet nunc, et elementum tortor nunc at eros. Donec malesuada congue molestie. Suspendisse potenti. Vestibulum cursus congue sem et feugiat. Morbi quis elit odio.

+
+
+ + + + + + +
+ +
+

Sweet AJAX Tabs

+ +
+ +
+
+ +
+ +

Here we are making sweet AJAX-powered tabs with CSS3 and the newly released version 1.4 of jQuery.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer luctus quam quis nibh fringilla sit amet consectetur lectus malesuada. Sed nec libero erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mi nisi, rhoncus ut vestibulum ac, sollicitudin quis lorem. Duis felis dui, vulputate nec adipiscing nec, interdum vel tortor. Sed gravida, erat nec rutrum tincidunt, metus mauris imperdiet nunc, et elementum tortor nunc at eros. Donec malesuada congue molestie. Suspendisse potenti. Vestibulum cursus congue sem et feugiat. Morbi quis elit odio.

+
+
+ + + + + +
+ +
+

Halftone Navigation Menu

+ +
+ +
+
+ +
+ +

Today we are making a CSS3 & jQuery halftone-style navigation menu, which will allow you to display animated halftone-style shapes in accordance with the navigation links, and will provide a simple editor for creating additional shapes as well.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer luctus quam quis nibh fringilla sit amet consectetur lectus malesuada. Sed nec libero erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mi nisi, rhoncus ut vestibulum ac, sollicitudin quis lorem. Duis felis dui, vulputate nec adipiscing nec, interdum vel tortor. Sed gravida, erat nec rutrum tincidunt, metus mauris imperdiet nunc, et elementum tortor nunc at eros. Donec malesuada congue molestie. Suspendisse potenti. Vestibulum cursus congue sem et feugiat. Morbi quis elit odio.

+
+
+ + + + +
+ + + +
+ + + + + + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/demo.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/demo.html new file mode 100644 index 00000000..fa7a7881 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/demo.html @@ -0,0 +1,43 @@ + + + + +Halftone Navigation Menu With jQuery & CSS3 | Tutorialzine demo + + + + + + + + + + + +

Halftone Navigation Menu With jQuery & CSS3

+

View the original tutorial »

+ + +
+ + + +
+ +
+
+ +

This is a tutorialzine demo. View the original tutorial, or download the source files.

+ + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/background.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/background.jpg new file mode 100644 index 00000000..e1e9ee38 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/background.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/button_bg.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/button_bg.jpg new file mode 100644 index 00000000..9e423c0c Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/button_bg.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/dot.png b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/dot.png new file mode 100644 index 00000000..5b64f9c5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/img/dot.png differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/script.js b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/script.js new file mode 100644 index 00000000..7cd3fbe5 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/script.js @@ -0,0 +1,121 @@ +/* Set serviceMode to true to create your own shapes: */ +var serviceMode = false; + +$(document).ready(function(){ + /* This code is executed after the DOM has been completely loaded */ + + var str=[]; + var perRow = 16; + + /* Generating the dot divs: */ + + for(var i=0;i<192;i++) + { + str.push('
'); + } + + /* Joining the array into a string and adding it to the inner html of the stage div: */ + + $('#stage').html(str.join('')); + + /* Using the hover method: */ + + $('#navigation li a').hover(function(e){ + + /* serviceDraw is a cut-out version of the draw function, used for shape editing and composing: */ + + if(serviceMode) + serviceDraw($(this).attr('class')); + else + draw($(this).attr('class')); + }, function(e){ + + }); + + /* Caching the dot divs into a variable for performance: */ + dots = $('.dot'); + + if(serviceMode) + { + /* If we are in service mode, show borders around the dot divs, add the export link, and listen for clicks: */ + + dots.css({ + border:'1px solid black', + width:dots.eq(0).width()-2, + height:dots.eq(0).height()-2, + cursor:'pointer' + }) + + $('
').css({ + position:'absolute', + bottom:-20, + right:0 + }).html('[Export Shape]').appendTo('#stage'); + + dots.click(function(){ + $(this).toggleClass('active'); + }); + } + +}); + +var shapes={ + + /* Each shape is described by an array of points. You can add your own shapes here, + just don't forget to add a coma after each array, except for the last one */ + + house:[22,37,38,39,52,53,54,55,56,67,68,69,70,71,72,73,82,83,84,85,86,87,88,89,90,99,100,104,105,115,116,120,121,131,132,136,137,147,148,150,151,152,153,163,164,166,167,168,169], + wrench:[22,23,24,25,26,27,38,39,40,41,42,43,54,55,58,59,70,71,86,87,88,89,101,102,103,104,105,116,117,118,131,132,133,146,147,148,163], + envelope:[34,35,36,37,38,39,40,41,42,43,44,50,51,52,58,59,60,66,68,69,73,74,76,82,85,86,88,89,92,98,102,103,104,108,114,119,124,130,140,146,147,148,149,150,151,152,153,154,155,156], + info:[22,23,38,39,69,70,71,86,87,102,103,118,119,134,135,150,151,166,167,168] +} + +var stopCounter = 0; +var dots; + +function draw(shape) +{ + /* This function draws a shape from the shapes object */ + + stopCounter++; + var currentCounter = stopCounter; + + dots.removeClass('active').css('opacity',0); + + $.each(shapes[shape],function(i,j){ + setTimeout(function(){ + + /* If a different shape animaton has been started during the showing of the current one, exit the function */ + if(currentCounter!=stopCounter) return false; + + dots.eq(j).addClass('active').fadeTo('slow',0.4); + + /* The fade animation is scheduled for 10*i millisecond in the future: */ + },10*i); + + }); +} + +function serviceDraw(shape) +{ + /* A cut out version of the draw function, used in service mode */ + + dots.removeClass('active'); + + $.each(shapes[shape],function(i,j){ + dots.eq(j).addClass('active'); + }); +} + +function outputString() +{ + /* Outputs the positions of the active dot divs as a comma-separated string: */ + + var str=[]; + $('.dot.active').each(function(){ + + str.push(this.id.replace('d-','')); + }) + + prompt('Insert this string as an array in the shapes object',str.join(',')); +} \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/styles.css b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/styles.css new file mode 100644 index 00000000..73897265 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/demo2/styles.css @@ -0,0 +1,148 @@ +body,h1,h2,h3,p,quote,small,form,input,ul,li,ol,label{ + /* Simple page reset */ + margin:0; + padding:0; +} + +body{ + /* Setting default text color, background and a font stack */ + color:#cccccc; + font-size:0.825em; + background: url(img/background.jpg) no-repeat center top #252525; + font-family:Arial, Helvetica, sans-serif; +} + +.menuUL li{ + /* This will arrange the LI-s next to each other */ + display:inline; +} + +.menuUL li a,.menuUL li a:visited{ + /* Styling the hyperlinks of the menu as buttons */ + + float:left; + font-weight:bold; + background:url(img/button_bg.jpg) repeat-x center bottom #666666; + + /* display:block allows for additinal CSS rules to take effect, such as paddings: */ + display:block; + border:1px solid #4D4D4D; + color:#CCCCCC; + border-top-color:#565656; + + padding:4px 6px; + margin:4px 5px; + height:16px; + + + /* Setting a CSS3 box shadow around the button */ + + -moz-box-shadow:0 0 1px black; + -webkit-box-shadow:0 0 1px black; + box-shadow:0 0 1px black; + + /* CSS3 text shadow */ + text-shadow:0 1px black; +} + +.menuUL li a:hover{ + /* On hover show the top, lighter, part of the background: */ + background-position:center top; + text-decoration:none; +} + +#navigation{ + /* The navigation menu bar: */ + background:#222222; + border:1px solid #111111; + float:left; + padding:5px 10px; +} + +#navigation,.menuUL li a{ + /* CSS3 rounded corners for both the navigation bar and the buttons: */ + -moz-border-radius:4px; + -webkit-border-radius:4px; + -khtml-border-radius:4px; + border-radius:4px; +} + +#stage{ + /* The stage contains the individual divs that comprise the halftone icon: */ + height:300px; + position:absolute; + right:50px; + top:20px; + width:400px; +} + +.dot{ + /* The stage contains 192 .dot divs: */ + float:left; + height:25px; + width:25px; +} + +.dot.active{ + /* When assigned the active class, the div shows a background image of a dot: */ + background:url(img/dot.png) no-repeat center center; +} + +.clear{ + /* Old-school clear fix hack to clear the floats: */ + clear:both; +} + +#main{ + margin:0 auto; + position:relative; + width:900px; +} + +/* The styles below are only necessary for the demo page */ + +h1{ + background:#222222; + border-bottom:1px solid black; + font-size:1.5em; + font-weight:normal; + margin-bottom:15px; + padding:15px; + text-align:center; +} + +h2 { + font-size:0.9em; + font-weight:normal; + padding-right:40px; + position:relative; + right:0; + text-align:right; + text-transform:uppercase; + top:-48px; +} + +a, a:visited { + color:#0196e3; + text-decoration:none; + outline:none; +} + +a:hover{ + text-decoration:underline; +} + +p.tutInfo{ + /* The tutorial info on the bottom of the page */ + padding:10px 0; + text-align:center; + position:absolute; + bottom:0px; + background:#222222; + border-top:1px solid black; + width:100%; +} + +h1,h2,p.tutInfo{ + font-family:"Myriad Pro",Arial,Helvetica,sans-serif; +} diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/DINMittelschriftStd.otf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/DINMittelschriftStd.otf new file mode 100644 index 00000000..9a6e0d4f Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/DINMittelschriftStd.otf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-LightCond.otf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-LightCond.otf new file mode 100644 index 00000000..a32c2f4a Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-LightCond.otf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-SemiboldCond.otf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-SemiboldCond.otf new file mode 100644 index 00000000..10b3bc97 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/MyriadPro-SemiboldCond.otf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/stan0755.ttf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/stan0755.ttf new file mode 100644 index 00000000..1d9e96b3 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/stan0755.ttf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahoma.ttf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahoma.ttf new file mode 100644 index 00000000..f5a011e9 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahoma.ttf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahomabd.ttf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahomabd.ttf new file mode 100644 index 00000000..1fd9f04f Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/tahomabd.ttf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebuc.ttf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebuc.ttf new file mode 100644 index 00000000..84891986 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebuc.ttf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebucbd.ttf b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebucbd.ttf new file mode 100644 index 00000000..663946d2 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/fonts/trebucbd.ttf differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/contentpage.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/contentpage.html new file mode 100644 index 00000000..efc4f6e0 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/contentpage.html @@ -0,0 +1,153 @@ + + + +Business Co. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ SEPTEMBER 29, 2009 +
+ + + + +
+
Content Page
HOME | ABOUT US | SERVICES | SOLUTIONS | SUPPORT | CONTACTS
+ Copyright © Your Company Name
+ Design by Templates Box. Create a free website. +
+ + + \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/css/styles.css b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/css/styles.css new file mode 100644 index 00000000..ae53ecae --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/css/styles.css @@ -0,0 +1,160 @@ +body{ + padding:0px; + margin:0px; + background:#c7c7c7; + color:#848484; + font:10px/14px Tahoma, sans-serif; +} + +div, p, ul, h2, h3, h4, img, form{padding:0px; margin:0px;} +ul{list-style-type:none;} + +.clear{ +clear:both; +} + +.frame { + border: 1px solid #D5E6E0; +} + +.text1 { + font: 11px/14px "Trebuchet MS", Arial, Helvetica, sans-serif; + color:#000; + font-weight:bold; +} +.text2 { + font: 11px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; +} +.text3 { + font: 10px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; +} + +.text4 { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#052578; + font-weight:bold; +} +.text5 { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#052578; + font-weight:bold; +} + + +a:link { + font: 11px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; + text-decoration:none; +} + +a:visited{ + font: 11px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; + text-decoration:none; +} + +a:hover { + font: 11px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; + text-decoration:underline; +} + +a.a:link { + font: 10px/14px Tahoma, Geneva, sans-serif; + color:#19a1cb; + font-weight:normal; + text-decoration:underline; +} + +a.a:visited{ + font: 10px/14px Tahoma, Geneva, sans-serif; + color:#19a1cb; + font-weight:normal; + text-decoration:underline; +} + +a.a:hover { + font: 10px/14px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; + text-decoration:none; +} + +a.b:link { + font: 10px/18px Tahoma, Geneva, sans-serif; + color:#848484; + font-weight:normal; + text-decoration:underline; +} + +a.b:visited{ + font: 10px/18px Tahoma, Geneva, sans-serif; + color:#848484; + font-weight:normal; + text-decoration:underline; +} + +a.b:hover { + font: 10px/18px Tahoma, Geneva, sans-serif; + color:#000; + font-weight:normal; + text-decoration:none; +} + +a.c:link { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:none; +} + +a.c:visited{ + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:none; +} + +a.c:hover { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:underline; +} + +a.d:link { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:none; +} + +a.d:visited{ + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:none; +} + +a.d:hover { + font: 10px/12px Tahoma, Geneva, sans-serif; + color:#FFF; + font-weight:normal; + text-decoration:underline; +} + +input, textarea, select{ +border:#fff 1px solid; +background-color:#d6e6e0; +font:10px/12px Tahoma, sans-serif; color:#000; +} +a.adv:link {text-decoration: none; font-weight:bold; color:#000;} +a.adv:hover {text-decoration: none; font-weight:bold; color:#000;} +a.adv:visited {text-decoration: none; font-weight:bold; color:#000;} diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/b_footer.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/b_footer.jpg new file mode 100644 index 00000000..761393bc Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/b_footer.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1.jpg new file mode 100644 index 00000000..0c6c95d7 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1_over.jpg new file mode 100644 index 00000000..4e59abf7 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_1_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2.jpg new file mode 100644 index 00000000..57927efd Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2_over.jpg new file mode 100644 index 00000000..1172e4c4 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_2_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3.jpg new file mode 100644 index 00000000..fc0e4693 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3_over.jpg new file mode 100644 index 00000000..d59bc6dd Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_3_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4.jpg new file mode 100644 index 00000000..72e59a64 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4_over.jpg new file mode 100644 index 00000000..61613ff9 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_4_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5.jpg new file mode 100644 index 00000000..bbd968d1 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5_over.jpg new file mode 100644 index 00000000..ac5aec7c Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_5_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6.jpg new file mode 100644 index 00000000..5be955d1 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6_over.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6_over.jpg new file mode 100644 index 00000000..0cda2dee Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/btn_6_over.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/client_login.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/client_login.jpg new file mode 100644 index 00000000..385bcf86 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/client_login.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-07.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-07.jpg new file mode 100644 index 00000000..10df1cb5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-07.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-09.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-09.jpg new file mode 100644 index 00000000..10df1cb5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-09.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-11.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-11.jpg new file mode 100644 index 00000000..10df1cb5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-11.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-13.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-13.jpg new file mode 100644 index 00000000..10df1cb5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines-13.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines.jpg new file mode 100644 index 00000000..10df1cb5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/lines.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-03.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-03.jpg new file mode 100644 index 00000000..c3323f9b Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-03.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-15.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-15.jpg new file mode 100644 index 00000000..15d72507 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main-15.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main.jpg new file mode 100644 index 00000000..708d2927 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/main.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-19.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-19.jpg new file mode 100644 index 00000000..4523abc1 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-19.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-20.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-20.jpg new file mode 100644 index 00000000..fbf11055 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news-20.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news.jpg new file mode 100644 index 00000000..56fc0ef2 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/news.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-23.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-23.jpg new file mode 100644 index 00000000..fcd98124 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-23.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-25.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-25.jpg new file mode 100644 index 00000000..e12c7086 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services-25.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services.jpg new file mode 100644 index 00000000..79debe4d Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/services.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight-24.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight-24.jpg new file mode 100644 index 00000000..cfad79f5 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight-24.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight.jpg new file mode 100644 index 00000000..d2da5b76 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/spotlight.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome-18.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome-18.jpg new file mode 100644 index 00000000..676b75ae Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome-18.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome.jpg new file mode 100644 index 00000000..00010aa4 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/images/welcome.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/index.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/index.html new file mode 100644 index 00000000..ee237b52 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/html/index.html @@ -0,0 +1,197 @@ + + + +Business Co. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ SEPTEMBER 29, 2009 +
+ + + + +
+
+ +
+ Lorem ipsum dolor sit amet, consectetuer
+Nam eu nulla. Donec lobortis purus vel urna. Nunc laoreet lacinia nunc. In volutpat sodales ipsum. Sed vestibulum. Integer in ante. Sed posuere ligula rhoncus erat. Fusce urna dui, sollicitudin ac, pulvinar quis
+

September 29 +

+

Integer in ante. Sed posuere ligula rhoncus erat. Fusce urna dui

September 28 +
+ Integer in ante. Sed posuere ligula rhoncus erat. Fusce urna dui
+
+
+ Lorem ipsum dolor sit amet, consectetuer
+ Nam eu nulla. Donec lobortis purus vel urna. Nunc laoreet lacinia nunc. In volutpat sodales ipsum. Sed vestibulum. rhoncus erat. Fusce urna dui, sollicitudin ac, pulvinar quis
+ Morbi volutpat leo in ligula. Inter vel
+ magna. sagittis. Fusce elit ligula,
+ sodales sit amet, tincid unt in, Fusce
+ interdum. Sed laoreet. Aenean. Sed
+laoreet. magna. sagittis. Fusce elit
+ Morbi volutpat leo in ligula. Inter vel magna. sagittis. Fusce elit ligula, sodales
+ sit amet, tincid unt in, Fusce interdum. Sed laoreet. Aenean. Sed laoreet.
HOME | ABOUT US | SERVICES | SOLUTIONS | SUPPORT | CONTACTS
+ Copyright © Your Company Name
+ Design by Templates Box. Create a free website. +
+ + + \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/jpeg/template276.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/jpeg/template276.jpg new file mode 100644 index 00000000..7bed98ec Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/jpeg/template276.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/psd/index.psd b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/psd/index.psd new file mode 100644 index 00000000..f1cffec8 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/psd/index.psd differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/readme.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/readme.html new file mode 100644 index 00000000..4e6cf8f0 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/example/readme.html @@ -0,0 +1,86 @@ + + + +TemplatesBox.com | Terms of Use + + + + + + + + + + + + + + + + + +
TemplatesBox + | Terms of Use
+ + + + +
+

By + downloading a template from TemplatesBox.com you agree to the following + Terms of Use: +

Our + web templates may be used for your own and/or your clients' websites, + but you may not sell/offer for free our templates in any sort of collection, + such as distributing to a third party via CD, diskette, or letting others + to download off your websites etc.
+
+ Link back to www.templatesbox.com is required and always appreciated. + Also, please visit the
+
Link + Us section.
+
+ The templates are offered "as is" without warranty of any kind, + either expressed or implied. TemplatesBox.com will not be liable for any + damage or loss of data whatsoever due to downloading or using a template. + In no event shall TemplatesBox.com be liable for any damages including, + but not limited to, direct, indirect, special, incidental or consequential + damages or other losses arising out of the use of or inability to use + the templates and/or information from TemplatesBox.com.
+
+ TemplatesBox.com team reserves the right to change or modify these terms + with no prior notice.

+
+
Featured + Partners
+ + + + +
+

Premium Website + Templates
+ Over 9000 High-end Website templates, Flash intros and Logo templates.
+
+
Free + Photos, Free Stock Photography
+
1000's of FREE high quality stock +Photos!
+
+
Webmaster Resources & +Directory
+
A large web directory with webmaster +resources.
+
+
Photovations.com
+
Online Photo Sharing. Free Image +Hosting

+
+
+ + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images.html new file mode 100644 index 00000000..032d3175 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images.html @@ -0,0 +1,9 @@ + + + +

Norwegian Mountain Trip

+Pulpit rock + + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/btn_1.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/btn_1.jpg new file mode 100644 index 00000000..0c6c95d7 Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/btn_1.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/pulpit.jpg b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/pulpit.jpg new file mode 100644 index 00000000..a9b8174d Binary files /dev/null and b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/images/pulpit.jpg differ diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/simple.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/simple.html new file mode 100644 index 00000000..f61058f3 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html/simple.html @@ -0,0 +1,10 @@ + + + +

My First Heading

+ +

My first paragraph.

+ + + + diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html5/dataset.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html5/dataset.html new file mode 100644 index 00000000..b4db4c29 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/html5/dataset.html @@ -0,0 +1,99 @@ + + + + + +HTML5 Demo: data-* + + + +
+
+

data-*

+
+ +
+
+

The data-[name] attribute on elements can now be accessed directly via the DOM using element.dataset.[attr].

+

Try openning the Web Console and editing element.dataset directly:
element.dataset.foo = 'bar';

+
+

Not connected

+
+
This element has data
+ + + +
+
[click buttons above to show element html]
+
+ + +
+Fork me on GitHub + + + + + \ No newline at end of file diff --git a/contrib/library/network/server/nino/example/SimpleWebServer/webroot/post/index.html b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/post/index.html new file mode 100644 index 00000000..85df7158 --- /dev/null +++ b/contrib/library/network/server/nino/example/SimpleWebServer/webroot/post/index.html @@ -0,0 +1,19 @@ + + + POST example + + +

POST example

+
+
+ + +
+ +
+
+ + +
+ + diff --git a/contrib/library/network/server/nino/library/README b/contrib/library/network/server/nino/library/README new file mode 100644 index 00000000..d84f5358 --- /dev/null +++ b/contrib/library/network/server/nino/library/README @@ -0,0 +1,5 @@ +Eiffel Web Nino is and HTTPD server. It's a work in progress, so maybe it will be refactored. +The goal of is to provide a simple web server for development (like Java, Python and Ruby provide) + + + diff --git a/contrib/library/network/server/nino/library/configuration/http_server_configuration.e b/contrib/library/network/server/nino/library/configuration/http_server_configuration.e new file mode 100644 index 00000000..5b552e35 --- /dev/null +++ b/contrib/library/network/server/nino/library/configuration/http_server_configuration.e @@ -0,0 +1,79 @@ +note + description: "Summary description for {HTTP_SERVER_CONFIGURATION}." + date: "$Date$" + revision: "$Revision$" + +class + HTTP_SERVER_CONFIGURATION + +create + make + +feature {NONE} -- Initialization + + make + do + http_server_port := 80 + max_tcp_clients := 100 + socket_accept_timeout := 1_000 + socket_connect_timeout := 5_000 + document_root := "htdocs" + force_single_threaded := False + end + +feature -- Access + + Server_details : STRING = "Server : NINO Eiffel Server" + + document_root: STRING assign set_document_root + http_server_port: INTEGER assign set_http_server_port + max_tcp_clients: INTEGER assign set_max_tcp_clients + socket_accept_timeout: INTEGER assign set_socket_accept_timeout + socket_connect_timeout: INTEGER assign set_socket_connect_timeout + force_single_threaded: BOOLEAN assign set_force_single_threaded + + is_verbose: BOOLEAN assign set_is_verbose + -- Display verbose message to the output? + +feature -- Element change + + set_http_server_port (v: like http_server_port) + do + http_server_port := v + end + + set_document_root (v: like document_root) + do + document_root := v + end + + set_max_tcp_clients (v: like max_tcp_clients) + do + max_tcp_clients := v + end + + set_socket_accept_timeout (v: like socket_accept_timeout) + do + socket_accept_timeout := v + end + + set_socket_connect_timeout (v: like socket_connect_timeout) + do + socket_connect_timeout := v + end + + set_force_single_threaded (v: like force_single_threaded) + do + force_single_threaded := v + end + + set_is_verbose (b: BOOLEAN) + -- Set `is_verbose' to `b' + do + is_verbose := b + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/http_connection_handler.e b/contrib/library/network/server/nino/library/http_connection_handler.e new file mode 100644 index 00000000..84e6d38b --- /dev/null +++ b/contrib/library/network/server/nino/library/http_connection_handler.e @@ -0,0 +1,199 @@ +note + description: "Summary description for {HTTP_CONNECTION_HANDLER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +deferred class + HTTP_CONNECTION_HANDLER + +inherit + HTTP_HANDLER + redefine + make + end + +feature {NONE} -- Initialization + + make (a_server: like server) + -- Creates a {HTTP_CONNECTION_HANDLER}, assigns the main_server and sets the current_request_message to empty. + -- + -- `a_server': The main server object + do + Precursor (a_server) + reset + end + + reset + do + has_error := False + create method.make_empty + create uri.make_empty + create request_header.make_empty + create request_header_map.make (10) + remote_info := Void + end + +feature -- Execution + + receive_message_and_send_reply (client_socket: TCP_STREAM_SOCKET) + local + l_remote_info: detachable like remote_info + do + create l_remote_info + if attached client_socket.peer_address as l_addr then + l_remote_info.addr := l_addr.host_address.host_address + l_remote_info.hostname := l_addr.host_address.host_name + l_remote_info.port := l_addr.port + remote_info := l_remote_info + end + + analyze_request_message (client_socket) + if has_error then + check catch_bad_incoming_connection: False end + if is_verbose then + log ("ERROR: invalid HTTP incoming request") + end + else + process_request (Current, client_socket) + end + reset + end + +feature -- Request processing + + process_request (a_handler: HTTP_CONNECTION_HANDLER; a_socket: TCP_STREAM_SOCKET) + -- Process request ... + require + no_error: not has_error + a_handler_attached: a_handler /= Void + a_uri_attached: a_handler.uri /= Void + a_method_attached: a_handler.method /= Void + a_header_map_attached: a_handler.request_header_map /= Void + a_header_text_attached: a_handler.request_header /= Void + a_socket_attached: a_socket /= Void + deferred + end + +feature -- Access + + request_header: STRING + -- Header' source + + request_header_map : HASH_TABLE [STRING,STRING] + -- Contains key:value of the header + + has_error: BOOLEAN + -- Error occurred during `analyze_request_message' + + method: STRING + -- http verb + + uri: STRING + -- http endpoint + + version: detachable STRING + -- http_version + --| unused for now + + remote_info: detachable TUPLE [addr: STRING; hostname: STRING; port: INTEGER] + -- Information related to remote client + +feature -- Parsing + + analyze_request_message (a_socket: TCP_STREAM_SOCKET) + -- Analyze message extracted from `a_socket' as HTTP request + require + input_readable: a_socket /= Void and then a_socket.is_open_read + local + end_of_stream : BOOLEAN + pos,n : INTEGER + line : detachable STRING + k, val: STRING + txt: STRING + l_is_verbose: BOOLEAN + do + create txt.make (64) + request_header := txt + + if attached next_line (a_socket) as l_request_line and then not l_request_line.is_empty then + txt.append (l_request_line) + txt.append_character ('%N') + analyze_request_line (l_request_line) + else + has_error := True + end + + l_is_verbose := is_verbose + + if not has_error or l_is_verbose then + -- if `is_verbose' we can try to print the request, even if it is a bad HTTP request + from + line := next_line (a_socket) + until + line = Void or end_of_stream + loop + n := line.count + if l_is_verbose then + log (line) + end + pos := line.index_of (':',1) + if pos > 0 then + k := line.substring (1, pos-1) + if line [pos+1].is_space then + pos := pos + 1 + end + if line [n] = '%R' then + n := n - 1 + end + val := line.substring (pos + 1, n) + request_header_map.put (val, k) + end + txt.append (line) + txt.append_character ('%N') + if line.is_empty or else line [1] = '%R' then + end_of_stream := True + else + line := next_line (a_socket) + end + end + end + end + + analyze_request_line (line: STRING) + -- Analyze `line' as a HTTP request line + require + valid_line: line /= Void and then not line.is_empty + local + pos, next_pos: INTEGER + do + if is_verbose then + log ("%N## Parse HTTP request line ##") + log (line) + end + pos := line.index_of (' ', 1) + method := line.substring (1, pos - 1) + next_pos := line.index_of (' ', pos + 1) + uri := line.substring (pos + 1, next_pos - 1) + version := line.substring (next_pos + 1, line.count) + has_error := method.is_empty + end + + next_line (a_socket: TCP_STREAM_SOCKET): detachable STRING + -- Next line fetched from `a_socket' is available. + require + is_readable: a_socket.is_open_read + do + if a_socket.socket_ok then + a_socket.read_line_thread_aware + Result := a_socket.last_string + end + end + +invariant + request_header_attached: request_header /= Void + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/http_constants.e b/contrib/library/network/server/nino/library/http_constants.e new file mode 100644 index 00000000..15b53088 --- /dev/null +++ b/contrib/library/network/server/nino/library/http_constants.e @@ -0,0 +1,149 @@ +note + description: "Summary description for {HTTP_CONSTANTS}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + HTTP_CONSTANTS + +feature + + http_version_1_1: STRING = "HTTP/1.1" + http_version_1_0: STRING = "HTTP/1.0" + crlf: STRING = "%/13/%/10/" + +feature -- Status codes + + -- 1xx Informational -Request received, continuing process + Continue : STRING = "100" + Switching_Protocols : STRING = "101" + + + -- 2xx Success - The action was successfully received, understood, and accepted + Ok: STRING = "200" + Created : STRING = "201" + Accepted : STRING = "202" + Non_Authoritative_Information : STRING = "203" + No_Content : STRING = "204" + Reset_Content : STRING = "205" + Parcial_Content : STRING = "206" + + + -- 3xx Redirection - Further Action must be taken in order to complete the request + Multiple_Choices : STRING = "300" + Moved_Permanently: STRING = "301" + Found : STRING = "302" + See_Other : STRING = "303" + Not_Modified : STRING = "304" + Use_Proxy : STRING = "305" + Temporary_Redirect : STRING = "307" + + + --4xx Client Error - The request contains bad syntax or cannot be fulfilled + Bad_Request : STRING = "400" + Unauthorized : STRING = "401" + Payment_Required : STRING = "402" + Forbidden : STRING = "403" + Not_Found : STRING = "404" + Method_Not_Allowed : STRING = "405" + Not_Acceptable : STRING = "406" + Proxy_Authentication_Required : STRING = "407" + Request_Time_out : STRING = "408" + Conflict : STRING = "409" + Gone : STRING = "410" + Length_Required : STRING = "411" + Precondition_Failed : STRING = "412" + Request_Entity_Too_Large : STRING = "413" + Request_URI_Too_Large : STRING = "414" + Unsupported_Media_Type : STRING = "415" + Requested_range_not_satisfiable : STRING = "416" + Expectation_Failed : STRING = "417" + + + --5xx Server Error - The server failed to fulfill an apparently valid request + server_error: STRING = "500" + Internal_Server_Error : STRING = "500" + Not_Implemented : STRING = "501" + Bad_Gateway : STRING = "502" + Service_Unavailable : STRING = "503" + Gateway_Time_out : STRING = "504" + HTTP_Version_not_supported : STRING = "505" + + + -- messages + ok_message: STRING = "OK" + continue_message : STRING = "Continue" + not_found_message: STRING = "URI not found" + not_implemented_message: STRING = "Not Implemented" + +feature -- content types + + text_html: STRING = "text/html" + +feature -- General Header Fields + + -- There are a few header fields which have general applicability for both request and response messages, + -- but which do not apply to the entity being transferred. + -- These header fields apply only to the message being transmitted. + + Cache_control : STRING = "Cache-Control" + Connection : STRING = "Connection" + Date : STRING = "Date" + Pragma : STRING = "PRAGMA" + Trailer : STRING = "Trailer" + Transfer_encoding : STRING = "Transfer-Encoding" + Upgrade : STRING = "Upgrade" + Via : STRING = "Via" + Warning : STRING = "Warning" + + +feature -- Request Header + Accept : STRING = "Accept" + Accept_charset : STRING = "Accept-Charset" + Accept_encoding : STRING = "Accept-Encoding" + Accept_language : STRING = "Accept-Language" + Authorization : STRING = "Authorization" + Expect : STRING = "Expect" + From_header : STRING = "From" + Host : STRING = "Host" + If_match : STRING = "If-Match" + If_modified_since : STRING = "If-Modified-Since" + If_none_match : STRING = "If-None-Match" + If_range : STRING = "If-Range" + If_unmodified_since : STRING = "If-Unmodified-Since" + Max_forwards : STRING = "Max-Forwards" + Proxy_authorization : STRING = "Proxy-Authorization" + Range : STRING = "Range" + Referer : STRING = "Referrer" + TE : STRING = "TE" + User_agent : STRING = "User-Agent" + + +feature -- Entity Header + + Allow : STRING = "Allow" + Content_encoding : STRING = "Content-Encoding" + Content_language : STRING = "Content-Language" + Content_length : STRING = "Content-Length" + Content_location : STRING = "Content-Location" + Content_MD5 : STRING = "Content-MD5" + Content_range : STRING = "Content-Range" + Content_type : STRING = "Content-Type" + Expires : STRING = "Expires" + Last_modified : STRING = "Last-Modified" + + +feature -- Http Method + Options : STRING = "OPTIONS" + Get : STRING = "GET" + Head : STRING = "HEAD" + Post : STRING = "POST" + Put : STRING = "PUT" + Delete : STRING = "DELETE" + Trace : STRING = "TRACE" + Connect : STRING = "CONNECT" +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/http_encoding_facilities.e b/contrib/library/network/server/nino/library/http_encoding_facilities.e new file mode 100644 index 00000000..81bc94ec --- /dev/null +++ b/contrib/library/network/server/nino/library/http_encoding_facilities.e @@ -0,0 +1,60 @@ +note + description: "[ + Provides features to encode and decode messages + ]" + legal: "See notice at end of class." + status: "Community Preview 1.0" + date: "$Date: 2009-09-01 19:15:37 -0300 (mar 01 de sep de 2009) $" + revision: "$Revision: 80577 $" + +class + HTTP_ENCODING_FACILITIES + +create + make + +feature -- Initialization + + make + do + end + +feature -- Conversion + + encode_natural(a_i: NATURAL; a_is_fragmented: BOOLEAN): NATURAL + -- Leftshift of the natural (don't use numbers >= 2^31) and subsequent append of the flag bit. + -- Use decode_natural and decode_flag for decoding. + require + no_too_big: a_i < 2147483648 + do + Result := (a_i |<< 1) + a_is_fragmented.to_integer.as_natural_32 + end + + change_flag(a_i: NATURAL; a_new_flag: BOOLEAN): NATURAL + -- Changes the flag to "new_flag" and doesn't change the encoded natural. + do + Result := (a_i & 0xFFFFFFFE) + a_new_flag.to_integer.as_natural_32 + end + + decode_natural_and_flag (a_i: NATURAL): TUPLE [NATURAL, BOOLEAN] + -- Convenience feature which combines both decodings (natural and flag) + do + Result := [decode_natural (a_i), decode_flag (a_i)] + end + + decode_natural (a_i: NATURAL): NATURAL + -- The natural that was encoded in {ENCODING_FACILITIES}.encode_natural. + do + Result := (a_i |>> 1) + end + + decode_flag (a_i: NATURAL): BOOLEAN + --`Result': the flag that was encoded in encode_natural + do + Result := (a_i.bit_and (1) = 1) + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/http_handler.e b/contrib/library/network/server/nino/library/http_handler.e new file mode 100644 index 00000000..20602184 --- /dev/null +++ b/contrib/library/network/server/nino/library/http_handler.e @@ -0,0 +1,220 @@ +note + description: "Summary description for {HTTP_CONNECTION_HANDLER}." + date: "$Date$" + revision: "$Revision$" + +deferred class + HTTP_HANDLER + +inherit + ANY + + HTTP_CONSTANTS + +feature {NONE} -- Initialization + + make (a_server: like server) + -- Creates a {HTTP_HANDLER}, assigns the server and initialize various values + -- + -- `a_server': The main server object + require + a_server_attached: a_server /= Void + do + server := a_server + is_stop_requested := False + ensure + server_set: a_server ~ server + end + +feature -- Output + + log (a_message: READABLE_STRING_8) + -- Log `a_message' + do + io.put_string (a_message) + io.put_new_line + end + +feature -- Inherited Features + + execute + -- + -- Creates a socket and connects to the http server. + local + l_listening_socket: detachable TCP_STREAM_SOCKET + l_http_port: INTEGER + do + launched := False + port := 0 + is_stop_requested := False + l_http_port := http_server_port + create l_listening_socket.make_server_by_port (l_http_port) + if not l_listening_socket.is_bound then + if is_verbose then + log ("Socket could not be bound on port " + l_http_port.out) + end + else + l_http_port := l_listening_socket.port + from + l_listening_socket.listen (max_tcp_clients) + if is_verbose then + log ("%NHTTP Connection Server ready on port " + l_http_port.out +" : http://localhost:" + l_http_port.out + "/") + end + on_launched (l_http_port) + until + is_stop_requested + loop + l_listening_socket.accept + if not is_stop_requested then + if attached l_listening_socket.accepted as l_thread_http_socket then + process_connection (l_thread_http_socket) + end + end + is_stop_requested := stop_requested_on_server + end + l_listening_socket.cleanup + check + socket_is_closed: l_listening_socket.is_closed + end + end + if launched then + on_stopped + end + if is_verbose then + log ("HTTP Connection Server ends.") + end + rescue + log ("HTTP Connection Server shutdown due to exception. Please relaunch manually.") + + if l_listening_socket /= Void then + l_listening_socket.cleanup + check + socket_is_closed: l_listening_socket.is_closed + end + end + if launched then + on_stopped + end + is_stop_requested := True + retry + end + + process_connection (a_socket: TCP_STREAM_SOCKET) + -- Process incoming connection + do + if is_verbose then + log ("Incoming connection...(socket:" + a_socket.descriptor.out + ")") + end + --| FIXME jfiat [2011/11/03] : should use a Pool of Threads/Handler to process this connection + --| also handle permanent connection...? + receive_message_and_send_reply (a_socket) + a_socket.cleanup + if is_verbose then + log ("connection completed...") + end + ensure + socket_closed: a_socket.is_closed + end + +feature -- Event + + on_launched (a_port: INTEGER) + -- Server launched using port `a_port' + require + not_launched: not launched + do + launched := True + port := a_port + ensure + launched: launched + end + + on_stopped + -- Server stopped + require + launched: launched + do + launched := False + ensure + stopped: not launched + end + +feature -- Access + + is_stop_requested: BOOLEAN + -- Set true to stop accept loop + + launched: BOOLEAN + -- Server launched and listening on `port' + + port: INTEGER + -- Listening port. + --| 0: not launched + +feature -- Access: configuration + + is_verbose: BOOLEAN + -- Is verbose for output messages. + do + Result := server_configuration.is_verbose + end + + force_single_threaded: BOOLEAN + do + Result := server_configuration.force_single_threaded + end + + http_server_port: INTEGER + do + Result := server_configuration.http_server_port + end + + max_tcp_clients: INTEGER + do + Result := server_configuration.max_tcp_clients + end + +feature {NONE} -- Access: server + + server: HTTP_SERVER + -- The main server object + + stop_requested_on_server: BOOLEAN + -- Stop requested on `server' object + do + Result := server.stop_requested + end + +feature {NONE} -- Access: configuration + + server_configuration: HTTP_SERVER_CONFIGURATION + -- The main server's configuration + do + Result := server.configuration + end + +feature -- Status setting + + shutdown + -- Stops the thread + do + is_stop_requested := True + end + +feature -- Execution + + receive_message_and_send_reply (client_socket: TCP_STREAM_SOCKET) + require + socket_attached: client_socket /= Void +-- socket_valid: client_socket.is_open_read and then client_socket.is_open_write + a_http_socket: not client_socket.is_closed + deferred + end + +invariant + server_attached: server /= Void + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/http_server.e b/contrib/library/network/server/nino/library/http_server.e new file mode 100644 index 00000000..26fb0df0 --- /dev/null +++ b/contrib/library/network/server/nino/library/http_server.e @@ -0,0 +1,56 @@ +note + description: "Summary description for {HTTP_SERVER}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + HTTP_SERVER + +create + make + +feature -- Initialization + + make (cfg: like configuration) + do + configuration := cfg + end + + setup (a_http_handler: HTTP_HANDLER) + require + a_http_handler_valid: a_http_handler /= Void + do + if configuration.is_verbose then + log ("%N%N%N") + log ("Starting Web Application Server (port="+ configuration.http_server_port.out +"):%N") + end + stop_requested := False + a_http_handler.execute + end + + shutdown_server + do + stop_requested := True + end + +feature -- Access + + configuration: HTTP_SERVER_CONFIGURATION + -- Configuration of the server + + stop_requested: BOOLEAN + -- Stops the server + +feature -- Output + + log (a_message: READABLE_STRING_8) + -- Log `a_message' + do + io.put_string (a_message) + end + +;note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/request/http_request_handler.e b/contrib/library/network/server/nino/library/request/http_request_handler.e new file mode 100644 index 00000000..8c2121c9 --- /dev/null +++ b/contrib/library/network/server/nino/library/request/http_request_handler.e @@ -0,0 +1,118 @@ +deferred class HTTP_REQUEST_HANDLER + +inherit + ANY + redefine + default_create + end + +feature {NONE} -- Initialization + + default_create + do + Precursor + create request_uri.make_empty + create script_name.make_empty + create query_string.make_empty + create answer + create headers.make (0) + end + +feature -- Access + + request_uri: STRING + -- requested url + + script_name: STRING + -- Script name + + query_string: STRING + -- Query string + + data: detachable STRING + -- the entire request message + + headers : HASH_TABLE [STRING, STRING] + -- Provides access to the request's HTTP headers, for example: + -- headers["Content-Type"] is "text/plain" + + answer: HTTP_RESPONSE + -- reply to this request + +feature -- Execution + + process + -- process the request and create an answer + require + valid_uri: request_uri /= Void + deferred + end + +feature -- Recycle + + reset + -- reinit the fields + do + request_uri.wipe_out + script_name.wipe_out + query_string.wipe_out + data := Void + answer.reset + end + +feature -- Element change + + set_uri (new_uri: STRING) + -- set new URI + require + valid_uri: new_uri /= Void + local + p: INTEGER + do + request_uri := new_uri + p := new_uri.index_of ('?', 1) + if p > 0 then + script_name := new_uri.substring (1, p - 1) + query_string := new_uri.substring (p + 1, new_uri.count) + else + script_name := new_uri.string + query_string := "" + end + end + + set_data (new_data: STRING) + -- set new data + do + data := new_data + end + + set_headers ( a_header : HASH_TABLE [STRING, STRING] ) + do + headers := a_header + end + +feature {NONE} -- Implementation + + real_filename (fn: STRING): STRING + -- Real filename from url-path `fn' + --| Find a better design for this piece of code + --| Eventually in a spec/$ISE_PLATFORM/ specific cluster + do + if {PLATFORM}.is_windows then + create Result.make_from_string (fn) + Result.replace_substring_all ("/", "\") + if Result[Result.count] = '\' then + Result.remove_tail (1) + end + else + Result := fn + if Result[Result.count] = '/' then + Result := Result.substring (1, Result.count - 1) + end + end + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/response/http_response.e b/contrib/library/network/server/nino/library/response/http_response.e new file mode 100644 index 00000000..eba6ee17 --- /dev/null +++ b/contrib/library/network/server/nino/library/response/http_response.e @@ -0,0 +1,147 @@ + +class HTTP_RESPONSE + +inherit + HTTP_CONSTANTS + redefine + default_create + end + +create + default_create + +feature -- creation + + default_create + do + Precursor + set_defaults + end + + set_defaults + -- Set default values for the reply + do + status_code := ok + create content_length_data.make_empty + reason_phrase := ok_message + content_type_data := text_html + set_reply_text (Void) + end + +feature -- Recycle + + reset + do + set_defaults + end + +feature -- response header fields + + status_code: STRING + -- status + + content_length_data : STRING + -- length + + reason_phrase: STRING + -- message, if any + + content_type_data: STRING + -- type of content in this reply (eg. text/html) + +feature -- Element change + + set_content_length (new_content_length: INTEGER) + require + positive_or_zero: new_content_length >= 0 + do + content_length_data := new_content_length.out + end + + set_status_code (new_status_code: STRING) + require + not_void: new_status_code /= Void + do + status_code := new_status_code + end + + set_reason_phrase (new_reason_phrase: STRING) + require + not_void: new_reason_phrase /= Void + do + reason_phrase := new_reason_phrase + end + + set_content_type (new_content_type: STRING) + require + not_void: new_content_type /= Void + do + content_type_data := new_content_type + end + +feature -- Access: send reply + + reply_header: STRING + -- header + do + Result := http_version_1_1.twin + Result.extend (' ') + Result.append (status_code) + Result.extend (' ') + Result.append (reason_phrase) + Result.append (crlf) + Result.append ({HTTP_SERVER_CONFIGURATION}.Server_details) + Result.append (crlf) + Result.append (Content_type + ": ") + Result.append (content_type_data) + Result.append (crlf) + Result.append (Content_length + ": ") + Result.append (content_length_data) + Result.append (crlf) + Result.append (crlf) + -- TODO: could add the size of data being sent here and + -- then keep the connection alive + end + + reply_header_continue: STRING + -- header + do + Result := http_version_1_1.twin + Result.extend (' ') + Result.append (status_code) + Result.extend (' ') + Result.append (continue_message) + Result.append (crlf) + Result.append (crlf) + -- TODO: could add the size of data being sent here and + -- then keep the connection alive + end + + reply_text: STRING + -- reply text + +feature -- Change element: send reply + + set_reply_text (new_text: detachable STRING) + -- text could be Void + do + if new_text = Void then + create reply_text.make_empty + else + reply_text := new_text + end + end + + append_reply_text (more_text: STRING) + -- add more text to the reply + require + reply_text /= Void + more_text /= Void + do + reply_text.append (more_text) + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/shared_uri_contents_types.e b/contrib/library/network/server/nino/library/shared_uri_contents_types.e new file mode 100644 index 00000000..1909737b --- /dev/null +++ b/contrib/library/network/server/nino/library/shared_uri_contents_types.e @@ -0,0 +1,18 @@ +note + description: "Summary description for {SHARED_URI_CONTENTS_TYPES}." + author: "" + date: "$Date$" + revision: "$Revision$" + +class + SHARED_URI_CONTENTS_TYPES +feature + + ct_table: URI_CONTENTS_TYPES + once + create Result.make + end +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/tcp_stream_socket.e b/contrib/library/network/server/nino/library/tcp_stream_socket.e new file mode 100644 index 00000000..308dfebe --- /dev/null +++ b/contrib/library/network/server/nino/library/tcp_stream_socket.e @@ -0,0 +1,59 @@ +note + description: "Summary description for {TCP_STREAM_SOCKET}." + date: "$Date$" + revision: "$Revision$" + +class + TCP_STREAM_SOCKET + +inherit + NETWORK_STREAM_SOCKET + +create + make_server_by_port + +create {NETWORK_STREAM_SOCKET} + make_from_descriptor_and_address + +feature -- Basic operation + + send_message (a_msg: STRING) + local + a_package : PACKET + a_data : MANAGED_POINTER + c_string : C_STRING + do + create c_string.make (a_msg) + create a_data.make_from_pointer (c_string.item, a_msg.count + 1) + create a_package.make_from_managed_pointer (a_data) + send (a_package, 1) + end + +feature -- Output + + put_readable_string_8 (s: READABLE_STRING_8) + -- Write readable string `s' to socket. + local + ext: C_STRING + do + create ext.make (s) + put_managed_pointer (ext.managed_data, 0, s.count) + end + +feature -- Status report + + try_ready_for_reading: BOOLEAN + -- Is data available for reading from the socket right now? + require + socket_exists: exists + local + retval: INTEGER + do + retval := c_select_poll_with_timeout (descriptor, True, 0) + Result := (retval > 0) + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/library/uri_contents_types.e b/contrib/library/network/server/nino/library/uri_contents_types.e new file mode 100644 index 00000000..9c60b3dc --- /dev/null +++ b/contrib/library/network/server/nino/library/uri_contents_types.e @@ -0,0 +1,91 @@ +class URI_CONTENTS_TYPES + +create + + make + + +feature + + content_types: HASH_TABLE [STRING, STRING] + + extension (uri: STRING): STRING + -- extract extendion from a URI + local + i: INTEGER + do + -- going from the end find the position of the "." + from + i := uri.count + until + i = 0 or else uri.item (i) = '.' + loop + i := i - 1 + end + Result := uri.substring (i+1, uri.count) + end + +feature {NONE} + + make + do + create content_types.make (30) + content_types.put ("text/html", "html") + content_types.put ("text/html", "htm") + content_types.put ("image/gif", "gif") + content_types.put ("image/jpeg", "jpeg") + content_types.put ("image/png", "jpg") + content_types.put ("image/png", "png") + end + + + +feature -- Access: Encoding + + urlencode (s: STRING): STRING + -- URL encode `s' + do + Result := s.string + Result.replace_substring_all ("#", "%%23") + Result.replace_substring_all (" ", "%%20") + Result.replace_substring_all ("%T", "%%09") + Result.replace_substring_all ("%N", "%%0A") + Result.replace_substring_all ("/", "%%2F") + Result.replace_substring_all ("&", "%%26") + Result.replace_substring_all ("<", "%%3C") + Result.replace_substring_all ("=", "%%3D") + Result.replace_substring_all (">", "%%3E") + Result.replace_substring_all ("%"", "%%22") + Result.replace_substring_all ("%'", "%%27") + end + + urldecode (s: STRING): STRING + -- URL decode `s' + do + Result := s.string + Result.replace_substring_all ("%%23", "#") + Result.replace_substring_all ("%%20", " ") + Result.replace_substring_all ("%%09", "%T") + Result.replace_substring_all ("%%0A", "%N") + Result.replace_substring_all ("%%2F", "/") + Result.replace_substring_all ("%%26", "&") + Result.replace_substring_all ("%%3C", "<") + Result.replace_substring_all ("%%3D", "=") + Result.replace_substring_all ("%%3E", ">") + Result.replace_substring_all ("%%22", "%"") + Result.replace_substring_all ("%%27", "%'") + end + + stripslashes (s: STRING): STRING + do + Result := s.string + Result.replace_substring_all ("\%"", "%"") + Result.replace_substring_all ("\'", "'") + Result.replace_substring_all ("\/", "/") + Result.replace_substring_all ("\\", "\") + end + +note + copyright: "2011-2011, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" +end diff --git a/contrib/library/network/server/nino/license.lic b/contrib/library/network/server/nino/license.lic new file mode 100644 index 00000000..6928e20b --- /dev/null +++ b/contrib/library/network/server/nino/license.lic @@ -0,0 +1,4 @@ +${NOTE_KEYWORD} + copyright: "2011-${YEAR}, Javier Velilla and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + diff --git a/contrib/library/network/server/nino/nino-safe.ecf b/contrib/library/network/server/nino/nino-safe.ecf new file mode 100644 index 00000000..b76c24df --- /dev/null +++ b/contrib/library/network/server/nino/nino-safe.ecf @@ -0,0 +1,20 @@ + + + + + + /.git$ + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + diff --git a/contrib/library/network/server/nino/nino.ecf b/contrib/library/network/server/nino/nino.ecf new file mode 100644 index 00000000..0b16ecfa --- /dev/null +++ b/contrib/library/network/server/nino/nino.ecf @@ -0,0 +1,20 @@ + + + + + + /.git$ + /EIFGENs$ + /CVS$ + /.svn$ + + + + + + + + + diff --git a/contrib/library/network/server/nino/nino.rc b/contrib/library/network/server/nino/nino.rc new file mode 100644 index 00000000..d3f5a12f --- /dev/null +++ b/contrib/library/network/server/nino/nino.rc @@ -0,0 +1 @@ + diff --git a/contrib/library/network/server/nino/readme.txt b/contrib/library/network/server/nino/readme.txt new file mode 100644 index 00000000..14e7c33f --- /dev/null +++ b/contrib/library/network/server/nino/readme.txt @@ -0,0 +1,38 @@ +Eiffel Nino HTTPD +================= +Eiffel Nino is and HTTPD server. It's a work in progress, so maybe it will be refactored. +The goal of is to provide a simple web server for development (like Java, Python and Ruby provide) +The code is based on Xebra and Emu Web Server. + + +Goal +======== +HTTPD server for development, support for HTTP 1.1. + + + + +Testing +======= +To test the HTTPD server, you could run the [example https://github.com/jvelilla/EiffelWebNino/tree/master/example/SimpleWebServer] +The server work fine in Windows and Linux. + +Run the server and point your browser to one of the following URIs + +1) http://localhost:9000/post/index.html +2) http://localhost:9000/demo1/template.html +3) http://localhost:9000/demo2/demo.html +4) http://localhost:9000/example/html/index.html +5) http://localhost:9000/html/simple.html +6) http://localhost:9000/html/images.html +7) http://localhost:9000/html/images.html +8) http://localhost:9000/html5/dataset.html + +Known Issues +============ + + + + + +