Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

拉下来很多地方不能用 #59

Open
wants to merge 2 commits into
base: 2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"require": {
"matyhtf/framework": ">=3.0.0",
"symfony/console": "^4.3",
"swoole/ide-helper": "~4.4.7"
"swoole/ide-helper": "~4.4.7",
"ext-json": "*"
}
}
6 changes: 3 additions & 3 deletions configs/db.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
$db['master'] = array(
'type' => SPF\Database::TYPE_MYSQLi,
'host' => "127.0.0.1",
'host' => "mysql",
'port' => 3306,
'dbms' => 'mysql',
'engine' => 'MyISAM',
'engine' => 'InnoDB',
'user' => "root",
'password' => "root",
'database' => "webim",
'charset' => "utf8",
'charset' => "utf8mb4",
'setname' => true,
'persistent' => false, //MySQL长连接
);
Expand Down
6 changes: 3 additions & 3 deletions configs/login.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
define('BASE_URL', 'http://www.swoole.com');
define('BASE_URL', 'http://127.0.0.1:9503');
return array(
'get_user_info' => BASE_URL . '/api/get_user_info/',
'passport' => BASE_URL.'/page/login/',
'get_user_info' => BASE_URL . '/api/get_user_info',
'passport' => BASE_URL.'/page/login',
);
2 changes: 1 addition & 1 deletion configs/redis.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$redis['master'] = array(
'host' => '127.0.0.1',
'host' => 'redis',
);
return $redis;
4 changes: 2 additions & 2 deletions configs/webim.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
$config['server'] = array(
//监听的HOST
'host' => '127.0.0.1',
'host' => '0.0.0.0',
//监听的端口
'port' => '9503',
//WebSocket的URL地址,供浏览器使用的
'url' => 'ws://127.0.0.1:9503',
//用于Comet跨域,必须设置为html所在的URL
'origin' => 'http://im.swoole.com:8888',
'origin' => 'http://127.0.0.1:9503',
);

$config['swoole'] = array(
Expand Down
23 changes: 23 additions & 0 deletions resources/static/facebox/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Facebox for Prototype, version 2.0
By Robert Gaal - http://wakoopa.com
--------------------------------------------------------------------------

Heavily based on Facebox by Chris Wanstrath - http://famspam.com/facebox
First ported to Prototype by Phil Burrows - http://blog.philburrows.com

Licensed under the MIT:
http://www.opensource.org/licenses/mit-license.php

Need help? Join the Google Groups mailing list:
http://groups.google.com/group/facebox/

--------------------------------------------------------------------------

Dependencies: prototype & script.aculo.us + images & CSS files from original facebox
Usage: Append 'rel="facebox"' to an element to call it inside a so-called facebox.

You can also call it directly through the following code:

facebox.loading();
facebox.reveal('Facebox contents here', null);
new Effect.Appear(facebox.facebox, {duration: .3});
Binary file added resources/static/facebox/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/facebox/bl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/facebox/br.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/facebox/closelabel.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions resources/static/facebox/facebox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#facebox .b {
background:url(b.png);
}

#facebox .tl {
background:url(tl.png);
}

#facebox .tr {
background:url(tr.png);
}

#facebox .bl {
background:url(bl.png);
}

#facebox .br {
background:url(br.png);
}

#facebox {
position: absolute;
top: 0;
left: 0;
z-index: 100;
text-align: left;
}

#facebox .popup {
position: relative;
}

#facebox table {
border-collapse: collapse;
}

#facebox td {
border-bottom: 0;
padding: 0;
}

#facebox .body {
padding: 10px;
background: #fff;
width: 370px;
}

#facebox .loading {
text-align: center;
}

#facebox .image {
text-align: center;
}

#facebox img {
border: 0;
margin: 0;
}

#facebox .footer {
border-top: 1px solid #DDDDDD;
padding-top: 5px;
margin-top: 10px;
text-align: right;
}

#facebox .tl, #facebox .tr, #facebox .bl, #facebox .br {
height: 10px;
width: 10px;
overflow: hidden;
padding: 0;
}

#facebox_overlay {
position: fixed;
top: 0px;
left: 0px;
height:100%;
width:100%;
}

.facebox_hide {
z-index:-100;
}

.facebox_overlayBG {
background-color: #000;
z-index: 99;
}

* html #facebox_overlay { /* ie6 hack */
position: absolute;
height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
189 changes: 189 additions & 0 deletions resources/static/facebox/facebox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/* Facebox for Prototype, version 2.0
* By Robert Gaal - http://wakoopa.com
*
* Heavily based on Facebox by Chris Wanstrath - http://famspam.com/facebox
* First ported to Prototype by Phil Burrows - http://blog.philburrows.com
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Need help? Join the Google Groups mailing list:
* http://groups.google.com/group/facebox/
*
* Dependencies: prototype & script.aculo.us + images & CSS files from original facebox
* Usage: Append 'rel="facebox"' to an element to call it inside a so-called facebox
*
*--------------------------------------------------------------------------*/


var Facebox = Class.create({
initialize : function(extra_set){
this.settings = {
loading_image : '/facebox/loading.gif',
close_image : '/facebox/closelabel.gif',
image_types : new RegExp('\.' + ['png', 'jpg', 'jpeg', 'gif'].join('|') + '$', 'i'),
inited : true,
facebox_html : '\
<div id="facebox" style="display:none;"> \
<div class="popup"> \
<table id="facebox_table"> \
<tbody> \
<tr> \
<td class="tl"/><td class="b"/><td class="tr"/> \
</tr> \
<tr> \
<td class="b"/> \
<td class="body"> \
<div class="content"> \
</div> \
<div class="footer"> \
<a href="#" class="close"> \
<img src="/facebox/closelabel.gif" title="close" class="close_image" /> \
</a> \
</div> \
</td> \
<td class="b"/> \
</tr> \
<tr> \
<td class="bl"/><td class="b"/><td class="br"/> \
</tr> \
</tbody> \
</table> \
</div> \
</div>'
};
if (extra_set) Object.extend(this.settings, extra_set);
$(document.body).insert({bottom: this.settings.facebox_html});

this.preload = [ new Image(), new Image() ];
this.preload[0].src = this.settings.close_image;
this.preload[1].src = this.settings.loading_image;

f = this;
$$('#facebox .b:first, #facebox .bl, #facebox .br, #facebox .tl, #facebox .tr').each(function(elem){
f.preload.push(new Image());
f.preload.slice(-1).src = elem.getStyle('background-image').replace(/url\((.+)\)/, '$1');
});

this.facebox = $('facebox');
this.keyPressListener = this.watchKeyPress.bindAsEventListener(this);

this.watchClickEvents();
fb = this;
Event.observe($$('#facebox .close').first(), 'click', function(e){
Event.stop(e);
fb.close()
});
Event.observe($$('#facebox .close_image').first(), 'click', function(e){
Event.stop(e);
fb.close()
});
},

watchKeyPress : function(e){
// Close if espace is pressed or if there's a click outside of the facebox
if (e.keyCode == 27 || !Event.element(e).descendantOf(this.facebox)) this.close();
},

watchClickEvents : function(e){
var f = this;
$$('a[rel=facebox]').each(function(elem,i){
Event.observe(elem, 'click', function(e){
Event.stop(e);
f.click_handler(elem, e);
});
});
},

loading : function() {
if ($$('#facebox .loading').length == 1) return true;

contentWrapper = $$('#facebox .content').first();
contentWrapper.childElements().each(function(elem, i){
elem.remove();
});
contentWrapper.insert({bottom: '<div class="loading"><img src="'+this.settings.loading_image+'"/></div>'});

var pageScroll = document.viewport.getScrollOffsets();
this.facebox.setStyle({
'top': pageScroll.top + (document.viewport.getHeight() / 10) + 'px',
'left': document.viewport.getWidth() / 2 - (this.facebox.getWidth() / 2) + 'px'
});

Event.observe(document, 'keypress', this.keyPressListener);
Event.observe(document, 'click', this.keyPressListener);
},

reveal : function(data, klass){
this.loading();
load = $$('#facebox .loading').first();
if(load) load.remove();

contentWrapper = $$('#facebox .content').first();
if (klass) contentWrapper.addClassName(klass);
contentWrapper.insert({bottom: data});

$$('#facebox .body').first().childElements().each(function(elem,i){
elem.show();
});

if(!this.facebox.visible()) new Effect.Appear(this.facebox, {duration: .3});
this.facebox.setStyle({
'left': document.viewport.getWidth() / 2 - (this.facebox.getWidth() / 2) + 'px'
});

Event.observe(document, 'keypress', this.keyPressListener);
Event.observe(document, 'click', this.keyPressListener);
},

close : function(){
new Effect.Fade('facebox', {duration: .3});
},

click_handler : function(elem, e){
this.loading();
Event.stop(e);

// support for rel="facebox[.inline_popup]" syntax, to add a class
var klass = elem.rel.match(/facebox\[\.(\w+)\]/);
if (klass) klass = klass[1];

new Effect.Appear(this.facebox, {duration: .3});

if (elem.href.match(/#/)){
var url = window.location.href.split('#')[0];
var target = elem.href.replace(url+'#','');
// var data = $$(target).first();
var d = $(target);
// create a new element so as to not delete the original on close()
var data = new Element(d.tagName);
data.innerHTML = d.innerHTML;
this.reveal(data, klass);
} else if (elem.href.match(this.settings.image_types)) {
var image = new Image();
fb = this;
image.onload = function() {
fb.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
}
image.src = elem.href;
} else {
var fb = this;
var url = elem.href;
new Ajax.Request(url, {
method : 'get',
onFailure : function(transport){
fb.reveal(transport.responseText, klass);
},
onSuccess : function(transport){
fb.reveal(transport.responseText, klass);
}
});

}
}
});

var facebox;
document.observe('dom:loaded', function(){
facebox = new Facebox();
});
Binary file added resources/static/facebox/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/facebox/tl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/static/facebox/tr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion resources/static/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var client_id = 0;
var userlist = {};
var GET = getRequest();
var face_count = 19;

$(document).ready(function() {
//使用原生WebSocket
//if (false)
Expand Down
Loading