This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function AjaxItems($container, config) { | |
var defaultOpts = { | |
textNoItems: "Не знайдено", | |
removalActionClass: "actionRemove", | |
removalDialog: function(el) { return confirm('Видалити?') }, | |
showNoItems: function($container, message) { | |
$container.empty().append( $div().text(message) ) | |
}, | |
// If you want item removal to be handled, add an element with class .actionRemove (or another specified in removalActionClass option) | |
itemDom: function(el) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ActiveActsBranch() | |
{ | |
// { actTypes: ..., searchTree: ... } | |
var meta = null | |
this.load = function(callback) | |
{ | |
if (typeof activeActsBranchTimestamp !== "undefined" && activeActsBranchTimestamp && $.jStorage.storageAvailable()) | |
{ | |
var savedTimestamp = $.jStorage.get('activeActsBranchTimestamp', null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class Router is static class which serves for routing purposes and can be used in 2 modes: full-map and on-the-go. | |
* | |
* Reads request uri path from $_GET['_REQUEST_URI'] | |
*/ | |
namespace _\web; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace _\lang; | |
use ReflectionFunction; | |
use RuntimeException; | |
/** | |
* Trait Lazy | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace _\integrations; | |
use _\Curl; | |
use _\lang\Arr; | |
use _\lang\Lazy; | |
use RuntimeException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# API ACCESS | |
* Access Point: http://affiliatex.com/api | |
* All fields must be passed in POST variables; GET variables will be ignored. | |
* You will have to retrieve a secret key in order to use AffiliateX API. | |
# API RESPONSE FORMAT | |
The response will be always JSON-encoded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace _\lang; | |
trait Classes | |
{ | |
static function fullClassName() | |
{ | |
return __CLASS__; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Router: | |
R::route('GET|POST', '/ajax', '\_\web\Ajax::processAjaxCall'); | |
# Handler method: | |
static function processAjaxCall() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Autoload that works only with _ namespace | |
if (!spl_autoload_register(function ($class) { | |
if (substr($class, 0, 2) !== '_\\') | |
return; | |
$class = (string)str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 2)); | |
$file = ROOT_PATH . '/_core/' . $class . '.php'; | |
if (file_exists($file)) | |
include $file; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RegExp.escape = function (text) { | |
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | |
} | |
if (!Math.sqr) { | |
Math.sqr = function (x) { | |
return x * x; | |
} | |
} |