Changeset 3014
- Timestamp:
- 10/20/05 22:13:42 (3 years ago)
- Files:
-
- trunk/Colloquy.xcodeproj/project.pbxproj (modified) (3 diffs)
- trunk/JVStyleView.m (modified) (1 diff)
- trunk/Plug-Ins/Web Interface/JVWebInterfacePlugin.m (modified) (1 diff)
- trunk/Plug-Ins/Web Interface/Resources/base.css (modified) (1 diff)
- trunk/Plug-Ins/Web Interface/Resources/common.js (modified) (6 diffs)
- trunk/Plug-Ins/Web Interface/Resources/index.html (modified) (1 diff)
- trunk/Plug-Ins/Web Interface/Web Interface.xcodeproj/project.pbxproj (modified) (4 diffs)
- trunk/Plug-Ins/Web Interface/nanohttpd/basic_modules.c (modified) (3 diffs)
- trunk/Resources/template.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Colloquy.xcodeproj/project.pbxproj
r2997 r3014 601 601 1CABFD0C0658629200801C15 /* JVStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JVStyle.h; sourceTree = "<group>"; }; 602 602 1CABFD0D0658629200801C15 /* JVStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JVStyle.m; sourceTree = "<group>"; }; 603 1CB2CD8C052DDC570094AAA4 /* Colloquy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Colloquy.app; sourceTree = BUILT_PRODUCTS_DIR; };603 1CB2CD8C052DDC570094AAA4 /* Colloquy.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Colloquy.app; sourceTree = BUILT_PRODUCTS_DIR; }; 604 604 1CB3716F060CC7E200F6A81F /* KABubbleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KABubbleWindowController.h; sourceTree = "<group>"; }; 605 605 1CB37170060CC7E200F6A81F /* KABubbleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KABubbleWindowController.m; sourceTree = "<group>"; }; … … 1899 1899 projectReferences = ( 1900 1900 { 1901 ProductGroup = 0A7F240B08556A9B00FA3D9B /* Products */; 1902 ProjectRef = 1C04394607CAFC7D00304949 /* AppleScript Support.xcodeproj */; 1903 }, 1904 { 1905 ProductGroup = 0A7F23F308556A6C00FA3D9B /* Products */; 1906 ProjectRef = 0A60C15F0630D96D00DC6280 /* Chat Core.xcodeproj */; 1907 }, 1908 { 1901 1909 ProductGroup = 0A7F242D08556AC100FA3D9B /* Products */; 1902 1910 ProjectRef = 1CE3F9BB07C7C29A0049A366 /* F-Script Support.xcodeproj */; 1903 },1904 {1905 ProductGroup = 1CBBDF5708B6EA92002A8BA6 /* Products */;1906 ProjectRef = 1CBBDF5608B6EA92002A8BA6 /* Ruby Support.xcodeproj */;1907 },1908 {1909 ProductGroup = 0A7F240B08556A9B00FA3D9B /* Products */;1910 ProjectRef = 1C04394607CAFC7D00304949 /* AppleScript Support.xcodeproj */;1911 1911 }, 1912 1912 { … … 1915 1915 }, 1916 1916 { 1917 ProductGroup = 0A7F23F308556A6C00FA3D9B/* Products */;1918 ProjectRef = 0A60C15F0630D96D00DC6280 /* Chat Core.xcodeproj */;1917 ProductGroup = 1CBBDF5708B6EA92002A8BA6 /* Products */; 1918 ProjectRef = 1CBBDF5608B6EA92002A8BA6 /* Ruby Support.xcodeproj */; 1919 1919 }, 1920 1920 ); trunk/JVStyleView.m
r3013 r3014 798 798 else shell = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"template" ofType:@"html"] encoding:NSUTF8StringEncoding error:NULL]; 799 799 800 return [NSString stringWithFormat:shell, @"", [resources absoluteString], [[[self emoticons] styleSheetLocation] absoluteString], [[[self style] mainStyleSheetLocation] absoluteString], variantStyleSheetLocation, [[[self style] baseLocation] absoluteString], [[self style] contentsOfBodyTemplateWithName:[self bodyTemplate]]];800 return [NSString stringWithFormat:shell, @"", @"", [resources absoluteString], [[[self emoticons] styleSheetLocation] absoluteString], [[[self style] mainStyleSheetLocation] absoluteString], variantStyleSheetLocation, [[[self style] baseLocation] absoluteString], [[self style] contentsOfBodyTemplateWithName:[self bodyTemplate]]]; 801 801 } 802 802 trunk/Plug-Ins/Web Interface/JVWebInterfacePlugin.m
r3002 r3014 270 270 bodyShell = [NSString stringWithContentsOfURL:bodyShellLocation encoding:NSUTF8StringEncoding error:NULL]; 271 271 272 bodyShell = ( [bodyShell length] ? [NSString stringWithFormat:bodyShell, @"/resources", content] : content ); 273 274 return [NSString stringWithFormat:shell, @"", @"/resources", emoticonStyleSheet, mainStyleSheet, variant, baseLocation, bodyShell]; 272 bodyShell = ( [bodyShell length] ? [NSString stringWithFormat:bodyShell, @"/resources", content] : content ); 273 274 int fontSize = [[[panel display] preferences] defaultFontSize]; 275 NSString *fontFamily = [[[panel display] preferences] sansSerifFontFamily]; 276 NSString *header = [NSString stringWithFormat:@"<style type=\"text/css\">body { font-size: %dpx; font-family: %@ }</style>", fontSize, fontFamily]; 277 278 return [NSString stringWithFormat:shell, [panel description], header, @"/resources", emoticonStyleSheet, mainStyleSheet, variant, baseLocation, bodyShell]; 275 279 } 276 280 trunk/Plug-Ins/Web Interface/Resources/base.css
r3011 r3014 48 48 position: absolute; 49 49 overflow: hidden; 50 outline: 0; 50 51 word-wrap: break-word; 51 52 } trunk/Plug-Ins/Web Interface/Resources/common.js
r3010 r3014 4 4 var scrollBackLimit = 300; 5 5 var activePanel = null; 6 var foreground = true; 6 7 7 8 function createRequestObject() { … … 15 16 currentRequest.open( "GET", "/command/setup" ); 16 17 currentRequest.send( null ); 18 19 function windowBlured() { 20 foreground = false; 21 } 22 23 function windowFocused() { 24 foreground = true; 25 activePanel.newMessage = 0; 26 activePanel.newHighlightMessage = 0; 27 activePanel.listItem.className = activePanel.listItem.className.replace( /\s*newMessage/g, "" ); 28 activePanel.listItem.className = activePanel.listItem.className.replace( /\s*newHighlight/g, "" ); 29 activePanel.listItem.title = "No messages waiting"; 30 } 17 31 18 32 function checkQueue() { … … 23 37 } 24 38 39 function panelForIdentifier( id ) { 40 for( var i = 0; i < panels.length; i++ ) 41 if( panels[i].id == id ) 42 return panels[i]; 43 return null; 44 } 45 25 46 function switchPanel( id ) { 26 47 for( var i = 0; i < panels.length; i++ ) { 27 48 var panel = panels[i]; 28 49 if( panel.id == id ) { 29 panel.frame.style.setProperty( "visibility", "visible", "" ); 30 panel.listItem.className += " selected"; 31 panel.active = true; 32 activePanel = panel; 50 if( ! panel.active ) { 51 panel.frame.style.setProperty( "visibility", "visible", "" ); 52 panel.listItem.className += " selected"; 53 panel.active = true; 54 panel.newMessage = 0; 55 panel.newHighlightMessage = 0; 56 panel.listItem.className = panel.listItem.className.replace( /\s*newMessage/g, "" ); 57 panel.listItem.className = panel.listItem.className.replace( /\s*newHighlight/g, "" ); 58 panel.listItem.title = "No messages waiting"; 59 activePanel = panel; 60 } 33 61 } else { 34 62 panel.frame.style.setProperty( "visibility", "hidden", "" ); 35 panel.listItem.className = panel.listItem.className.replace( /\s*selected/ , "" );63 panel.listItem.className = panel.listItem.className.replace( /\s*selected/g, "" ); 36 64 panel.active = false; 37 65 } … … 40 68 41 69 function createPanel( id, name, server, type ) { 70 if( panelForIdentifier( id ) ) return; 71 42 72 var panel = new Object(); 43 73 panel.id = id; … … 45 75 panel.server = server; 46 76 panel.type = type; 77 panel.newMessage = 0; 78 panel.newHighlightMessage = 0; 79 panel.active = false; 47 80 panel.frame = document.createElement( "iframe" ); 48 81 panel.listItem = document.createElement( "li" ); … … 117 150 messages++; 118 151 var message = children[i]; 152 var id = message.getAttribute( "panel" ); 119 153 appendMessage( message.getAttribute( "panel" ), message.firstChild.nodeValue ); 154 var panel = panelForIdentifier( id ); 155 if( ( ( ! foreground && panel.active ) || ! panel.active ) && panel.listItem.className.indexOf( "newMessage" ) == -1 ) { 156 panel.listItem.className += " newMessage"; 157 panel.newMessage++; 158 panel.listItem.title = panel.newMessage + " messages waiting"; 159 } 120 160 break; 121 161 } trunk/Plug-Ins/Web Interface/Resources/index.html
r3010 r3014 9 9 <script type="text/ecmascript" defer="defer" src="common.js" encoding="utf-8" /> 10 10 </head> 11 <body >11 <body onblur="windowBlured()" onfocus="windowFocused()"> 12 12 <div id="main"> 13 13 <div id="panels"></div> trunk/Plug-Ins/Web Interface/Web Interface.xcodeproj/project.pbxproj
r2996 r3014 8 8 9 9 /* Begin PBXBuildFile section */ 10 1C3458F20905FC4F00AC2C16 /* base.css in Resources */ = {isa = PBXBuildFile; fileRef = 1C3458F10905FC4800AC2C16 /* base.css */; }; 10 11 1C36998308FF75A200F34892 /* JVWebInterfacePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C36998208FF75A200F34892 /* JVWebInterfacePlugin.m */; }; 11 12 1C3699BC08FF768900F34892 /* basic_modules.c in Sources */ = {isa = PBXBuildFile; fileRef = 1C3699AF08FF768900F34892 /* basic_modules.c */; }; … … 49 50 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 50 51 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 52 1C3458F10905FC4800AC2C16 /* base.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = base.css; path = Resources/base.css; sourceTree = "<group>"; }; 51 53 1C36998108FF75A200F34892 /* JVWebInterfacePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JVWebInterfacePlugin.h; sourceTree = "<group>"; }; 52 54 1C36998208FF75A200F34892 /* JVWebInterfacePlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JVWebInterfacePlugin.m; sourceTree = "<group>"; }; … … 111 113 1CC7250B0901A775004651F8 /* index.html */, 112 114 1CC7265F0901BAAE004651F8 /* common.js */, 115 1C3458F10905FC4800AC2C16 /* base.css */, 113 116 ); 114 117 name = Resources; … … 264 267 1CC7250C0901A775004651F8 /* index.html in Resources */, 265 268 1CC726710901BBD2004651F8 /* common.js in Resources */, 269 1C3458F20905FC4F00AC2C16 /* base.css in Resources */, 266 270 ); 267 271 runOnlyForDeploymentPostprocessing = 0; trunk/Plug-Ins/Web Interface/nanohttpd/basic_modules.c
r3001 r3014 56 56 } 57 57 58 DIR *dir = opendir( filename);58 DIR *dir = opendir( real ); 59 59 if( ! dir ) { 60 60 #ifdef LOG_HTTP … … 108 108 109 109 struct stat sb; 110 if( stat( filename, &sb ) < 0 ) {110 if( stat( real, &sb ) < 0 ) { 111 111 resp -> status_code = 404; 112 112 resp -> reason_phrase = "Cannot access document"; … … 122 122 123 123 const char *content_type = NULL; 124 char *ext = getext( filename);124 char *ext = getext( real ); 125 125 if( ext ) content_type = server -> get_mime( server, ext ); 126 126 if( content_type ) resp -> content_type = (char *)content_type; 127 127 128 int fd = open( filename, O_RDONLY );128 int fd = open( real, O_RDONLY ); 129 129 if( fd > 0 ) { 130 130 char buf[1024]; trunk/Resources/template.html
r2963 r3014 7 7 <meta name="formatter" content="libxslt 1.1.11" /> 8 8 <title>%@</title> 9 %@ 9 10 <script id="defaultScript" type="text/ecmascript" defer="defer" src="%@/default.js" encoding="utf-8" /> 10 <link id="defaultStyle" rel="stylesheet" type="text/css" href="% 2$@/default.css" />11 <link id="defaultStyle" rel="stylesheet" type="text/css" href="%3$@/default.css" /> 11 12 <link id="emoticonStyle" rel="stylesheet" type="text/css" href="%@" /> 12 13 <link id="mainStyle" rel="stylesheet" type="text/css" href="%@" />
