Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Implemented real-time notification with signalR and Hangfire. #675
Conversation
合并从源fork来的代码
Added Farsi Language Localization (#671)
merge code from simplcommerce:master
merge code from simplcommerce:master
|
@Nongzhsh sorry for the late response, I was super busy recently. There is too much code in this PR, it will take time to review :) |
|
@thiennn Hi, I have synced the latest code and solved the conflict. Can you take a moment to check it? Thank you very much. |
|
@Nongzhsh Can we move the RealTime folder in Core to a separate module? I think we should keep the Core module thin |
|
@thiennn Okay, got it. We can refactor it. |
|
We should handle the notifications events (send and received events) on the client. We can use https://github.com/bcerati/js-event-bus |
event bus basic <html>
<head>
<script>
var simplCommerce = simplCommerce || {};
/* SIMPLE EVENT BUS *****************************************/
simplCommerce.event = (function () {
var _callbacks = {};
var on = function (eventName, callback) {
if (!_callbacks[eventName]) {
_callbacks[eventName] = [];
}
_callbacks[eventName].push(callback);
};
var off = function (eventName, callback) {
var callbacks = _callbacks[eventName];
if (!callbacks) {
return;
}
var index = -1;
for (var i = 0; i < callbacks.length; i++) {
if (callbacks[i] === callback) {
index = i;
break;
}
}
if (index < 0) {
return;
}
_callbacks[eventName].splice(index, 1);
};
var trigger = function (eventName) {
var callbacks = _callbacks[eventName];
if (!callbacks || !callbacks.length) {
return;
}
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < callbacks.length; i++) {
callbacks[i].apply(this, args);
}
};
// Public interface ///////////////////////////////////////////////////
return {
on: on,
off: off,
trigger: trigger
};
})();
</script>
</head>
<body>
<button id="btnTest" onclick="javascript:btnTest_click();">Test</button>
<script>
simplCommerce.event.on('simplCommerce.init', function (notification) {
alert(notification);
});
simplCommerce.event.on('simplCommerce.init', function (notification) {
alert(notification + ' ok');
});
var btnTest_click = function(){
simplCommerce.event.trigger('simplCommerce.init', 'test 123');
}
</script>
</body>
</html> |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

@thiennn Hi, i added the HangfireJobs module and Notifications module.
Please review it, then I will implement user notification management.
Looking forward to your reply.