-
- {% else %}
-
- {% endif %}
-
-
- {% endmacro %}
diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig
deleted file mode 100644
index d924be4..0000000
--- a/main/app/sprinkles/FormGenerator/templates/FormGenerator/macros/textarea.html.twig
+++ /dev/null
@@ -1,6 +0,0 @@
-{% macro generate(input) %}
- {% if input.icon %}
- {% endif %}
-
- {% if input.icon %}
{% endif %}
-{% endmacro %}
\ No newline at end of file
diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig
deleted file mode 100644
index b2de3f9..0000000
--- a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal-large.html.twig
+++ /dev/null
@@ -1,3 +0,0 @@
-{% extends "FormGenerator/modal.html.twig" %}
-
-{% block modal_size %}modal-lg{% endblock %}
diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig
deleted file mode 100644
index 82d3ea0..0000000
--- a/main/app/sprinkles/FormGenerator/templates/FormGenerator/modal.html.twig
+++ /dev/null
@@ -1,65 +0,0 @@
-{% block modal %}
-
-{% endblock %}
-
-{% block scripts_page %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig b/main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig
deleted file mode 100644
index 3e5c079..0000000
--- a/main/app/sprinkles/FormGenerator/templates/FormGenerator/typehead.html.twig
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "FormGenerator/modal.html.twig" %}
-
-{% block scripts_page %}
- {{ parent() }}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php b/main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php
deleted file mode 100644
index d75f4f7..0000000
--- a/main/app/sprinkles/FormGenerator/tests/Unit/FormGeneratorTest.php
+++ /dev/null
@@ -1,402 +0,0 @@
-basePath = __DIR__ . '/data';
- }
-
- /**
- * Test the base `Test` element class works on it's own
- */
- public function testTextFormElement() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/good.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // Get TextInput from the `name` element of the schema
- $inputSchema = $schema["name"]["form"];
- $textInput = new \UserFrosting\Sprinkle\FormGenerator\Element\Text("name", $inputSchema);
-
- // Test instanceof $textInput
- $this->assertInstanceof(InputInterface::class, $textInput);
-
- // Parse the input
- $text = $textInput->parse();
-
- // Test the parsing
- $expected = [
- "type" => "text",
- "label" => "Project Name",
- "icon" => "fa-flag",
- "autocomplete" => "off",
- "class" => "form-control",
- "placeholder" => "Project Name",
- 'name' => 'name',
- 'id' => 'field_name',
- 'value' => ''
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $text);
- }
-
- /**
- * This test make sure the `Text` element works correctly when a current
- * value is passed to the constructor. Should return the same as the
- * previous test, but with the `value` setup instead of empty
- */
- public function testTextFormElementWithData() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/good.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // Get TextInput from the `name` element of the schema
- $inputSchema = $schema["name"]["form"];
- $textInput = new \UserFrosting\Sprinkle\FormGenerator\Element\Text("name", $inputSchema, "The Bar project");
-
- // Test instanceof $textInput
- $this->assertInstanceof(InputInterface::class, $textInput);
-
- // Parse the input
- $text = $textInput->parse();
-
- // Test the parsing
- $expected = [
- "type" => "text",
- "label" => "Project Name",
- "icon" => "fa-flag",
- "autocomplete" => "off",
- "class" => "form-control",
- "placeholder" => "Project Name",
- 'name' => 'name',
- 'id' => 'field_name',
- 'value' => 'The Bar project'
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $text);
- }
-
- /**
- * This test is the same as the one before, but we test the `owener` field with some data
- * This make sure the `default` schema field will work correctly when empty data is passed
- */
- public function testTextFormElementWithEmptyData() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/good.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // Get TextInput from the `name` element of the schema
- $inputSchema = $schema["owner"]["form"];
- $textInput = new \UserFrosting\Sprinkle\FormGenerator\Element\Text("owner", $inputSchema, "");
-
- // Test instanceof $textInput
- $this->assertInstanceof(InputInterface::class, $textInput);
-
- // Parse the input
- $text = $textInput->parse();
-
- // Test the parsing
- $expected = [
- 'label' => 'Project Owner',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '', //Shoudn't be a value here ! "" is overwritting "Foo"
- 'name' => 'owner',
- 'id' => 'owner',
- 'type' => 'text',
- 'icon' => 'fa-user',
- 'placeholder' => 'Project Owner',
- 'default' => 'Foo'
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $text);
- }
-
- /**
- * Test the Form Class.
- * Run the test with no current values (empty form)
- */
- public function testForm() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/good.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // Generate the form
- $form = new Form($schema);
-
- // Test to make sure the class creation is fine
- $this->assertInstanceof(Form::class, $form);
-
- // Test the form generation
- $generatedForm = $form->generate();
- $this->assertInternalType("array", $generatedForm);
-
- // Test one of the form input
- $expected = [
- 'number' => [
- 'label' => 'Project Number',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '',
- 'name' => 'number',
- 'id' => 'field_number',
- 'type' => 'number',
- 'icon' => 'fa-edit',
- 'placeholder' => 'Project Number'
- ],
- 'owner' => [
- 'label' => 'Project Owner',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => 'Foo',
- 'name' => 'owner',
- 'id' => 'owner',
- 'type' => 'text',
- 'icon' => 'fa-user',
- 'placeholder' => 'Project Owner',
- 'default' => 'Foo'
- ],
- 'name' => [
- 'label' => 'Project Name',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '',
- 'name' => 'name',
- 'id' => 'field_name',
- 'type' => 'text',
- 'icon' => 'fa-flag',
- 'placeholder' => 'Project Name'
- ],
- 'description' => [
- 'label' => 'Project Description',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '',
- 'name' => 'description',
- 'rows' => 5,
- 'id' => 'field_description',
- 'type' => 'textarea',
- 'icon' => 'fa-pencil',
- 'placeholder' => 'Project Description'
- ],
- 'status' => [
- 'label' => 'Project Status',
- 'class' => 'form-control js-select2',
- 'value' => '',
- 'name' => 'status',
- 'id' => 'field_status',
- 'type' => 'select',
- 'options' => [
- 0 => 'Closed',
- 1 => 'Open'
- ]
- ],
- 'active' => [
- 'label' => 'Active',
- 'class' => 'js-icheck',
- 'name' => 'active',
- 'id' => 'field_active',
- 'type' => 'checkbox',
- 'binary' => TRUE
- ],
- 'hidden' => [
- 'value' => 'Something',
- 'name' => 'hidden',
- 'id' => 'field_hidden',
- 'type' => 'hidden'
- ],
- 'alert' => [
- 'class' => 'alert-success',
- 'icon' => 'fa-check',
- 'value' => 'You\'re awesome!',
- 'name' => 'alert',
- 'type' => 'alert'
- ]
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $generatedForm);
- }
-
- /**
- * Test the Form Clas with values to make sure filled form works correctly
- */
- public function testFormWithData() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/good.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // The data
- $data = [
- "name" => "Bar project",
- "owner" => "",
- "description" => "The bar project is less awesome, but at least it's open.",
- "status" => 1,
- "hiddenString" => "The Bar secret code is...",
- "completion" => 12,
- "active" => TRUE
- ];
-
- // Generate the form
- $form = new Form($schema, $data);
-
- // Test to make sure the class creation is fine
- $this->assertInstanceof(Form::class, $form);
-
- // Test the form generation
- $generatedForm = $form->generate();
- $this->assertInternalType("array", $generatedForm);
-
- // Test one of the form input
- $expected = [
- 'number' => [
- 'label' => 'Project Number',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '',
- 'name' => 'number',
- 'id' => 'field_number',
- 'type' => 'number',
- 'icon' => 'fa-edit',
- 'placeholder' => 'Project Number'
- ],
- 'name' => [
- 'label' => 'Project Name',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => 'Bar project', //Value here !
- 'name' => 'name',
- 'id' => 'field_name',
- 'type' => 'text',
- 'icon' => 'fa-flag',
- 'placeholder' => 'Project Name'
- ],
- 'owner' => [
- 'label' => 'Project Owner',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => '', //Shoudn't be a value here ! "" is overwritting "Foo"
- 'name' => 'owner',
- 'id' => 'owner',
- 'type' => 'text',
- 'icon' => 'fa-user',
- 'placeholder' => 'Project Owner',
- 'default' => 'Foo'
- ],
- 'description' => [
- 'label' => 'Project Description',
- 'autocomplete' => 'off',
- 'class' => 'form-control',
- 'value' => 'The bar project is less awesome, but at least it\'s open.', //Value here !
- 'name' => 'description',
- 'rows' => 5,
- 'id' => 'field_description',
- 'type' => 'textarea',
- 'icon' => 'fa-pencil',
- 'placeholder' => 'Project Description'
- ],
- 'status' => [
- 'label' => 'Project Status',
- 'class' => 'form-control js-select2',
- 'value' => 1, //Value here !
- 'name' => 'status',
- 'id' => 'field_status',
- 'type' => 'select',
- 'options' => [
- 0 => 'Closed',
- 1 => 'Open'
- ]
- ],
- 'active' => [
- 'label' => 'Active',
- 'class' => 'js-icheck',
- 'name' => 'active',
- 'id' => 'field_active',
- 'type' => 'checkbox',
- 'checked' => 'checked', //Value here !
- 'binary' => TRUE
- ],
- 'hidden' => [
- 'value' => 'Something',
- 'name' => 'hidden',
- 'id' => 'field_hidden',
- 'type' => 'hidden'
- ],
- 'alert' => [
- 'class' => 'alert-success',
- 'icon' => 'fa-check',
- 'value' => 'You\'re awesome!',
- 'name' => 'alert',
- 'type' => 'alert'
- ]
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $generatedForm);
- }
-
- /**
- * Test a non existant input type. It's supposed to not find the class and
- * default back to the `Text` element class.
- */
- public function testUndefinedFormElement() {
- // Get Schema
- $loader = new YamlFileLoader($this->basePath . '/bad.json');
- $schema = new RequestSchemaRepository($loader->load());
-
- // Generate the form
- $form = new Form($schema);
-
- // Test to make sure the class creation is fine
- $this->assertInstanceof(Form::class, $form);
-
- // Test the form generation
- $generatedForm = $form->generate();
- $this->assertInternalType("array", $generatedForm);
-
- // Test one of the form input
- $expected = [
- "type" => "foo",
- "autocomplete" => "off",
- "class" => "form-control",
- 'name' => 'myField',
- 'id' => 'field_myField',
- 'value' => ''
- ];
-
- // We test the generated result
- $this->assertEquals($expected, $generatedForm['myField']);
- }
-}
diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json b/main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json
deleted file mode 100644
index 50f1c00..0000000
--- a/main/app/sprinkles/FormGenerator/tests/Unit/data/bad.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "myField": {
- "form": {
- "type": "foo"
- }
- },
- "myOtherField": {
- "form": {
- "value": "Bar"
- }
- }
-}
diff --git a/main/app/sprinkles/FormGenerator/tests/Unit/data/good.json b/main/app/sprinkles/FormGenerator/tests/Unit/data/good.json
deleted file mode 100644
index 1592515..0000000
--- a/main/app/sprinkles/FormGenerator/tests/Unit/data/good.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "number": {
- "form": {
- "type": "number",
- "label": "Project Number",
- "icon": "fa-edit",
- "placeholder": "Project Number"
- }
- },
- "name": {
- "form": {
- "type": "text",
- "label": "Project Name",
- "icon": "fa-flag",
- "placeholder": "Project Name"
- }
- },
- "owner": {
- "form": {
- "type": "text",
- "label": "Project Owner",
- "icon": "fa-user",
- "id": "owner",
- "placeholder": "Project Owner",
- "default": "Foo"
- }
- },
- "description": {
- "form": {
- "type": "textarea",
- "label": "Project Description",
- "icon": "fa-pencil",
- "placeholder": "Project Description",
- "rows": 5
- }
- },
- "status": {
- "form": {
- "type": "select",
- "label": "Project Status",
- "options": {
- "0": "Closed",
- "1": "Open"
- }
- }
- },
- "active": {
- "form": {
- "type": "checkbox",
- "label": "Active"
- }
- },
- "hidden": {
- "form": {
- "type": "hidden",
- "value": "Something"
- }
- },
- "alert": {
- "form": {
- "type": "alert",
- "class": "alert-success",
- "icon": "fa-check",
- "value": "You're awesome!"
- }
- }
-}
diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js
index 962bf4c..95247fc 100644
--- a/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js
+++ b/main/app/sprinkles/account/assets/userfrosting/js/pages/forgot-password.js
@@ -8,7 +8,6 @@
*/
$(document).ready(function () {
- // TODO: Process form
$("#request-password-reset").ufForm({
validators: page.validators.forgot_password,
msgTarget: $("#alerts-page")
diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js
index 3e9eea1..7da85fa 100644
--- a/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js
+++ b/main/app/sprinkles/account/assets/userfrosting/js/pages/resend-verification.js
@@ -8,7 +8,6 @@
*/
$(document).ready(function () {
- // TODO: Process form
$("#request-verification-email").ufForm({
validators: page.validators.resend_verification,
msgTarget: $("#alerts-page")
diff --git a/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js b/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js
index 5e60bb1..62fbf4b 100644
--- a/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js
+++ b/main/app/sprinkles/account/assets/userfrosting/js/pages/set-or-reset-password.js
@@ -13,7 +13,6 @@ $(document).ready(function () {
msgTarget: $("#alerts-page")
}).on("submitSuccess.ufForm", function () {
// Forward to home page on success
- // TODO: forward to landing/last page
window.location.replace(site.uri.public + "/account/sign-in");
});
});
diff --git a/main/app/sprinkles/account/src/Authenticate/Authenticator.php b/main/app/sprinkles/account/src/Authenticate/Authenticator.php
index 8ee51b8..735a688 100644
--- a/main/app/sprinkles/account/src/Authenticate/Authenticator.php
+++ b/main/app/sprinkles/account/src/Authenticate/Authenticator.php
@@ -181,7 +181,7 @@ class Authenticator
* This method logs in the specified user, allowing the client to assume the user's identity for the duration of the session.
* @param User $user The user to log in.
* @param bool $rememberMe Set to true to make this a "persistent session", i.e. one that will re-login even after the session expires.
- * @todo Figure out a way to update the currentUser service to reflect the logged-in user *immediately* in the service provider.
+ * @odo Figure out a way to update the currentUser service to reflect the logged-in user *immediately* in the service provider.
* As it stands, the currentUser service will still reflect a "guest user" for the remainder of the request.
*/
public function login($user, $rememberMe = FALSE) {
diff --git a/main/app/sprinkles/account/src/Controller/AccountController.php b/main/app/sprinkles/account/src/Controller/AccountController.php
index 25961ec..7373923 100644
--- a/main/app/sprinkles/account/src/Controller/AccountController.php
+++ b/main/app/sprinkles/account/src/Controller/AccountController.php
@@ -65,7 +65,7 @@ class AccountController extends SimpleController
// Validate, and halt on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
+ // O: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException('Missing or malformed request data!');
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
@@ -163,8 +163,8 @@ class AccountController extends SimpleController
* This is because we need to allow users to re-request a reset, even if they lose the first reset email.
* This route is "public access".
* Request type: POST
- * @todo require additional user information
- * @todo prevent password reset requests for root account?
+ * @odo require additional user information
+ * @odo prevent password reset requests for root account?
*
* @param Request $request
* @param Response $response
@@ -244,8 +244,6 @@ class AccountController extends SimpleController
}
});
- // TODO: create delay to prevent timing-based attacks
-
$ms->addMessageTranslated('success', 'PASSWORD.FORGET.REQUEST_SENT', ['email' => $data['email']]);
return $response->withStatus(200);
}
@@ -1191,7 +1189,7 @@ class AccountController extends SimpleController
*
* This route is "public access".
* Request type: GET
- * @todo Can this route be abused for account enumeration? If so we should throttle it as well.
+ * @odo Can this route be abused for account enumeration? If so we should throttle it as well.
*
* @param Request $request
* @param Response $response
diff --git a/main/app/sprinkles/account/src/Database/Models/Group.php b/main/app/sprinkles/account/src/Database/Models/Group.php
index b904eb5..f0a1e1f 100644
--- a/main/app/sprinkles/account/src/Database/Models/Group.php
+++ b/main/app/sprinkles/account/src/Database/Models/Group.php
@@ -47,7 +47,7 @@ class Group extends Model
/**
* Delete this group from the database, along with any user associations
*
- * @todo What do we do with users when their group is deleted? Reassign them? Or, can a user be "groupless"?
+ * @odo What do we do with users when their group is deleted? Reassign them? Or, can a user be "groupless"?
*/
public function delete() {
// Delete the group
diff --git a/main/app/sprinkles/account/src/Database/Models/User.php b/main/app/sprinkles/account/src/Database/Models/User.php
index 6a7996a..b401db2 100644
--- a/main/app/sprinkles/account/src/Database/Models/User.php
+++ b/main/app/sprinkles/account/src/Database/Models/User.php
@@ -178,8 +178,6 @@ class User extends Model
$classMapper->staticMethod('password_reset', 'where', 'user_id', $this->id)->delete();
$classMapper->staticMethod('verification', 'where', 'user_id', $this->id)->delete();
- // TODO: remove any persistences
-
// Delete the user
$result = parent::forceDelete();
} else {
@@ -332,7 +330,7 @@ class User extends Model
*
* By default, adds a new sign-in activity and updates any legacy hash.
* @param mixed[] $params Optional array of parameters used for this event handler.
- * @todo Transition to Laravel Event dispatcher to handle this
+ * @odo Transition to Laravel Event dispatcher to handle this
*/
public function onLogin($params = []) {
// Add a sign in activity (time is automatically set by database)
@@ -369,7 +367,7 @@ class User extends Model
*
* By default, adds a new sign-out activity.
* @param mixed[] $params Optional array of parameters used for this event handler.
- * @todo Transition to Laravel Event dispatcher to handle this
+ * @do Transition to Laravel Event dispatcher to handle this
*/
public function onLogout($params = []) {
static::$ci->userActivityLogger->info("User {$this->user_name} signed out.", [
diff --git a/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php b/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php
index e21b5d6..21ff548 100644
--- a/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php
+++ b/main/app/sprinkles/account/src/Repository/PasswordResetRepository.php
@@ -28,7 +28,7 @@ class PasswordResetRepository extends TokenRepository
*/
protected function updateUser($user, $args) {
$user->password = Password::hash($args['password']);
- // TODO: generate user activity? or do this in controller?
+ // DO: generate user activity? or do this in controller?
$user->save();
}
}
diff --git a/main/app/sprinkles/account/src/Repository/VerificationRepository.php b/main/app/sprinkles/account/src/Repository/VerificationRepository.php
index 405efc5..d714dce 100644
--- a/main/app/sprinkles/account/src/Repository/VerificationRepository.php
+++ b/main/app/sprinkles/account/src/Repository/VerificationRepository.php
@@ -26,7 +26,6 @@ class VerificationRepository extends TokenRepository
*/
protected function updateUser($user, $args) {
$user->flag_verified = 1;
- // TODO: generate user activity? or do this in controller?
$user->save();
}
}
diff --git a/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php b/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php
index 5c1bf20..38d81d5 100644
--- a/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php
+++ b/main/app/sprinkles/account/src/ServicesProvider/ServicesProvider.php
@@ -346,7 +346,7 @@ class ServicesProvider
/**
* This method is invoked when a user attempts to perform certain public actions when they are already logged in.
*
- * @todo Forward to user's landing page or last visited page
+ * Forward to user's landing page or last visited page
* @param \Psr\Http\Message\ServerRequestInterface $request
* @param \Psr\Http\Message\ResponseInterface $response
* @param array $args
diff --git a/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js b/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js
index 952b241..7951807 100644
--- a/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js
+++ b/main/app/sprinkles/admin/assets/userfrosting/js/widgets/users.js
@@ -107,7 +107,7 @@ function updateUser(userName, fieldName, fieldValue) {
console.log("Error (" + jqXHR.status + "): " + jqXHR.responseText);
// Display errors on failure
- // TODO: ufAlerts widget should have a 'destroy' method
+ // ufAlerts widget should have a 'destroy' method
if (!$("#alerts-page").data('ufAlerts')) {
$("#alerts-page").ufAlerts();
} else {
diff --git a/main/app/sprinkles/admin/routes/posts.php b/main/app/sprinkles/admin/routes/posts.php
index fa2ee4a..ac523b2 100644
--- a/main/app/sprinkles/admin/routes/posts.php
+++ b/main/app/sprinkles/admin/routes/posts.php
@@ -9,7 +9,9 @@
/**
* Routes for posting.
*/
-$app->get('/image/{PostID}', 'UserFrosting\Sprinkle\Admin\Controller\PostController:showImage')->add('authGuard');
+$app->get('/feed/{user_name}', 'UserFrosting\Sprinkle\Admin\Controller\PostController:getFeed')->add('authGuard');
+
+$app->get('/image/{post_id}', 'UserFrosting\Sprinkle\Admin\Controller\PostController:showImage')->add('authGuard');
$app->group('/api/posts', function () {
$this->post('/image', 'UserFrosting\Sprinkle\Admin\Controller\PostController:postImage');
diff --git a/main/app/sprinkles/admin/routes/users.php b/main/app/sprinkles/admin/routes/users.php
index ddc1353..6bace28 100644
--- a/main/app/sprinkles/admin/routes/users.php
+++ b/main/app/sprinkles/admin/routes/users.php
@@ -25,8 +25,6 @@ $app->group('/api/users', function () {
$this->get('/u/{user_name}/activities', 'UserFrosting\Sprinkle\Admin\Controller\UserController:getActivities');
- $this->get('/u/{user_name}/posts', 'UserFrosting\Sprinkle\Admin\Controller\UserController:getActivities');
-
$this->get('/u/{user_name}/roles', 'UserFrosting\Sprinkle\Admin\Controller\UserController:getRoles');
$this->get('/u/{user_name}/permissions', 'UserFrosting\Sprinkle\Admin\Controller\UserController:getPermissions');
diff --git a/main/app/sprinkles/admin/src/Controller/GroupController.php b/main/app/sprinkles/admin/src/Controller/GroupController.php
index 2077363..720f12d 100644
--- a/main/app/sprinkles/admin/src/Controller/GroupController.php
+++ b/main/app/sprinkles/admin/src/Controller/GroupController.php
@@ -692,7 +692,6 @@ class GroupController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
diff --git a/main/app/sprinkles/admin/src/Controller/PostController.php b/main/app/sprinkles/admin/src/Controller/PostController.php
index 98bee5a..18efff9 100644
--- a/main/app/sprinkles/admin/src/Controller/PostController.php
+++ b/main/app/sprinkles/admin/src/Controller/PostController.php
@@ -29,6 +29,48 @@ use Illuminate\Database\Capsule\Manager as DB;
class PostController extends SimpleController
{
+ /**
+ * Gets the feed of the requested user (for non-administrators only own feed allowed)
+ *
+ * @param Request $request
+ * @param Response $response
+ * @param $args
+ * @throws BadRequestException
+ * @throws NotFoundException
+ */
+ public function getFeed(Request $request, Response $response, $args) {
+ $user = $this->getUserFromParams($args);
+
+ // If the user doesn't exist, return 404
+ if (!$user) {
+ throw new NotFoundException($request, $response);
+ }
+
+ // Get friends first
+ $UsersFriends = DB::select("SELECT id FROM (SELECT user_id AS id FROM user_follow WHERE followed_by_id = $user->id UNION ALL SELECT followed_by_id FROM user_follow WHERE user_id = $user->id) t GROUP BY id HAVING COUNT(id) > 1");
+ /** @var UserFrosting\Sprinkle\Core\Util\ClassMapper $classMapper */
+ $classMapper = $this->ci->classMapper;
+ foreach ($UsersFriends as $Key => $UsersFriendId) { // NOT THAT EFFICIENT...
+ $UsersFriendInformation = $classMapper->createInstance('user')// raw select doesnt work with instance
+ ->where('id', $UsersFriendId->id)
+ ->get();
+
+ $ImagesFromFriends[] = DB::table('image_posts')
+ ->where('UserID', '=', $UsersFriendInformation[0]->id)
+ ->value('File');
+ }
+ }
+
+ /**
+ * Shows the requested image
+ *
+ * @param Request $request
+ * @param Response $response
+ * @param $args
+ * @return Response
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ */
public function showImage(Request $request, Response $response, $args) {
// check if user is authorized
$authorizer = $this->ci->authorizer;
@@ -36,7 +78,7 @@ class PostController extends SimpleController
if (!$authorizer->checkAccess($currentUser, 'view_image')) {
throw new ForbiddenException();
}
- $postID = $args['PostID'];
+ $postID = $args['post_id'];
// get filename from database
$FileRequestedImage = DB::table('image_posts')
@@ -54,6 +96,14 @@ class PostController extends SimpleController
}
}
+ /**
+ * posts a image
+ *
+ * @param Request $request
+ * @param Response $response
+ * @return Response
+ * @throws ForbiddenException
+ */
public function postImage(Request $request, Response $response) {
// check if user is authorized
$authorizer = $this->ci->authorizer;
@@ -82,10 +132,15 @@ class PostController extends SimpleController
DB::table('image_posts')
->insert(['UserID' => $currentUser->id, 'File' => $filename]);
- $response->write('Uploaded successfully!
');
+ return $response->write('Uploaded successfully!
');
}
}
+ /**
+ * @param $params
+ * @return mixed
+ * @throws BadRequestException
+ */
protected function getUserFromParams($params) {
// Load the request schema
$schema = new RequestSchema('schema://requests/user/get-by-username.yaml');
@@ -97,7 +152,6 @@ class PostController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
diff --git a/main/app/sprinkles/admin/src/Controller/RoleController.php b/main/app/sprinkles/admin/src/Controller/RoleController.php
index e4ebd98..80ac6a0 100644
--- a/main/app/sprinkles/admin/src/Controller/RoleController.php
+++ b/main/app/sprinkles/admin/src/Controller/RoleController.php
@@ -836,7 +836,6 @@ class RoleController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
@@ -894,7 +893,7 @@ class RoleController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
+ // encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
diff --git a/main/app/sprinkles/admin/src/Controller/UserController.php b/main/app/sprinkles/admin/src/Controller/UserController.php
index 3621fbc..52e4d1a 100644
--- a/main/app/sprinkles/admin/src/Controller/UserController.php
+++ b/main/app/sprinkles/admin/src/Controller/UserController.php
@@ -46,6 +46,9 @@ class UserController extends SimpleController
* This route requires authentication.
* Request type: POST
* @see getModalCreate
+ * @throws ForbiddenException
+ * @throws BadRequestException
+ * @throws ForbiddenException
*/
public function create($request, $response, $args) {
// Get POST parameters: user_name, first_name, last_name, email, locale, (group)
@@ -176,6 +179,9 @@ class UserController extends SimpleController
* 4. The submitted data is valid.
* This route requires authentication.
* Request type: POST
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function createPasswordReset($request, $response, $args) {
// Get the username from the URL
@@ -235,6 +241,9 @@ class UserController extends SimpleController
/**
* Sets the users public key
* Request type: POST
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function setPublicKey($request, $response, $args) {
$requestedUser = $this->getUserFromParams($args);
@@ -270,6 +279,10 @@ class UserController extends SimpleController
* 2. You have permission to delete the target user's account.
* This route requires authentication (and should generally be limited to admins or the root user).
* Request type: DELETE
+ * @throws BadRequestException
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function delete($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -332,6 +345,9 @@ class UserController extends SimpleController
*
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getActivities($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -377,6 +393,9 @@ class UserController extends SimpleController
*
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getInfo($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -423,6 +442,7 @@ class UserController extends SimpleController
* Generates a list of users, optionally paginated, sorted and/or filtered.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
*/
public function getList($request, $response, $args) {
// GET parameters
@@ -455,6 +475,10 @@ class UserController extends SimpleController
* This does NOT render a complete page. Instead, it renders the HTML for the modal, which can be embedded in other pages.
* This page requires authentication.
* Request type: GET
+ * @throws BadRequestException
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getModalConfirmDelete($request, $response, $args) {
// GET parameters
@@ -507,6 +531,7 @@ class UserController extends SimpleController
* Otherwise, the user will be added to the default group and receive the default roles automatically.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
*/
public function getModalCreate($request, $response, $args) {
// GET parameters
@@ -533,7 +558,6 @@ class UserController extends SimpleController
$config = $this->ci->config;
// Determine form fields to hide/disable
- // TODO: come back to this when we finish implementing theming
$fields = [
'hidden' => ['theme'],
'disabled' => []
@@ -590,6 +614,9 @@ class UserController extends SimpleController
* This does NOT render a complete page. Instead, it renders the HTML for the modal, which can be embedded in other pages.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getModalEdit($request, $response, $args) {
// GET parameters
@@ -676,6 +703,9 @@ class UserController extends SimpleController
* This does NOT render a complete page. Instead, it renders the HTML for the form, which can be embedded in other pages.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getModalEditPassword($request, $response, $args) {
// GET parameters
@@ -720,6 +750,9 @@ class UserController extends SimpleController
* This does NOT render a complete page. Instead, it renders the HTML for the form, which can be embedded in other pages.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getModalEditRoles($request, $response, $args) {
// GET parameters
@@ -757,6 +790,9 @@ class UserController extends SimpleController
* Generates a list of permissions, optionally paginated, sorted and/or filtered.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getPermissions($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -801,6 +837,9 @@ class UserController extends SimpleController
*
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getRoles($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -848,6 +887,8 @@ class UserController extends SimpleController
* This will also try to show buttons for activating, disabling/enabling, deleting, and editing the user.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
+ * @throws BadRequestException
*/
public function pageInfo($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -977,6 +1018,7 @@ class UserController extends SimpleController
* Actions typically include: edit user details, activate user, enable/disable user, delete user.
* This page requires authentication.
* Request type: GET
+ * @throws ForbiddenException
*/
public function pageList($request, $response, $args) {
/** @var UserFrosting\Sprinkle\Account\Authorize\AuthorizationManager $authorizer */
@@ -996,6 +1038,8 @@ class UserController extends SimpleController
/**
* Gets the users public key
* Request type: GET
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getPublicKey($request, $response, $args) {
$requestedUser = $this->getUserFromParams($args);
@@ -1026,13 +1070,16 @@ class UserController extends SimpleController
}
return $response->withStatus(200);
} else {
- throw new NotFoundException();
+ throw new NotFoundException($request, $response);
}
}
/**
* Gets the users which are following the requested user
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getFollowers($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -1069,6 +1116,9 @@ class UserController extends SimpleController
/**
* Get users which the user follows
* Request type: GET
+ * @throws ForbiddenException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function getFollows($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -1085,9 +1135,9 @@ class UserController extends SimpleController
$currentUser = $this->ci->currentUser;
// Access-controlled page
- if (!$authorizer->checkAccess($currentUser, 'uri_user', [
- 'user' => $user
- ])) {
+ if (($user->id == $currentUser->id) || (!$authorizer->checkAccess($currentUser, 'uri_user', [
+ 'user' => $user
+ ]))) {
throw new ForbiddenException();
}
@@ -1105,6 +1155,9 @@ class UserController extends SimpleController
/**
* Get users which the user follows and which are following the user
* Request type: GET
+ * @throws NotFoundException
+ * @throws ForbiddenException
+ * @throws BadRequestException
*/
public function getFriends($request, $response, $args) {
$user = $this->getUserFromParams($args);
@@ -1133,7 +1186,7 @@ class UserController extends SimpleController
$classMapper = $this->ci->classMapper;
foreach ($UsersFriends as $Key => $UsersFriendId) { // NOT THAT EFFICIENT...
- $UsersFriendInformation = $classMapper->createInstance('user')// select doesnt work with instance
+ $UsersFriendInformation = $classMapper->createInstance('user')// raw select doesnt work with instance
->where('id', $UsersFriendId->id)
->get();
@@ -1145,7 +1198,11 @@ class UserController extends SimpleController
$result = $UsersFriends;
- return $response->withJson($result, 200, JSON_PRETTY_PRINT);
+ if (sizeof($result) > 0) { // USER HAS FRIENDS
+ return $response->withJson($result, 200, JSON_PRETTY_PRINT);
+ } else {
+ throw new NotFoundException($request, $response);
+ }
}
@@ -1158,6 +1215,10 @@ class UserController extends SimpleController
* 3. The submitted data is valid.
* This route requires authentication.
* Request type: PUT
+ * @throws NotFoundException
+ * @throws ForbiddenException
+ * @throws BadRequestException
+ * @throws BadRequestException
*/
public function updateInfo($request, $response, $args) {
// Get the username from the URL
@@ -1277,6 +1338,14 @@ class UserController extends SimpleController
* 3. The submitted data is valid.
* This route requires authentication.
* Request type: PUT
+ * @throws ForbiddenException
+ * @throws BadRequestException
+ * @throws BadRequestException
+ * @throws BadRequestException
+ * @throws BadRequestException
+ * @throws BadRequestException
+ * @throws NotFoundException
+ * @throws BadRequestException
*/
public function updateField($request, $response, $args) {
// Get the username from the URL
@@ -1336,7 +1405,7 @@ class UserController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
+ // encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
@@ -1426,7 +1495,6 @@ class UserController extends SimpleController
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
- // TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach ($field as $eidx => $error) {
diff --git a/main/app/sprinkles/core/asset-bundles.json b/main/app/sprinkles/core/asset-bundles.json
index e3dbdc1..ef8e244 100644
--- a/main/app/sprinkles/core/asset-bundles.json
+++ b/main/app/sprinkles/core/asset-bundles.json
@@ -51,7 +51,6 @@
"SiteAssets/js/encryption.js",
"SiteAssets/js/swiper.js",
"SiteAssets/js/console.image.js",
- "SiteAssets/js/imageCaching.js",
"SiteAssets/js/popups.js",
"SiteAssets/js/push.js",
"SiteAssets/js/chat.js",
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
index d54cbe6..484102d 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
@@ -250,11 +250,13 @@ function InitializeChatServer() {
ChatTextInput.keyup(function (e) {
if (ChatSocket.readyState === 1) {
if (e.keyCode === 13 && ChatTextInput.val().length > 0) {
+ const ChatTextInputText = ChatTextInput.val();
+ ChatTextInput.val("");
var LastMessage = $(".MessageWrapper.Normal:last .ChatMessage");
if (!LastMessage.hasClass("MessageSent")) { // CHECK IF PREVIOUS MESSAGE WAS FROM HIMSELF TOO -> IF NOT, CREATE NEW 'ALONE' MESSAGE
- ChatMessages.append("
" + ChatTextInput.val() + "
");
+ ChatMessages.append("
" + ChatTextInputText + "
");
} else if (LastMessage.hasClass("MessageSent")) { // IF PREVIOUS MESSAGE WAS FROM HIMSELF TOO -> CREATE WITH CORRESPONDING CLASSES FOR DESIGN
- ChatMessages.append("
" + ChatTextInput.val() + "
");
+ ChatMessages.append("
" + ChatTextInputText + "
");
if (LastMessage.hasClass("AloneMessage")) {
LastMessage.removeClass("AloneMessage");
LastMessage.addClass("TopMessage");
@@ -271,7 +273,7 @@ function InitializeChatServer() {
// ENCRYPT AND SEND MESSAGE WITH OWN PUBLIC KEY
options = {
- data: ChatTextInput.val(),
+ data: ChatTextInputText,
publicKeys: openpgp.key.readArmored(PublicKey[current_username]).keys,
privateKeys: [privKeyObj] // FOR SIGNING
};
@@ -284,13 +286,11 @@ function InitializeChatServer() {
EncryptedWithKeyOfUsername: current_username,
Message: EncryptedMessage
}));
- ChatTextInput.val("");
- ChatTextInput.val("");
});
// ENCRYPT AND SEND MESSAGE WITH RECEIVERS PUBLIC KEY
options = {
- data: ChatTextInput.val(),
+ data: ChatTextInputText,
publicKeys: openpgp.key.readArmored(PublicKey[ReceiversUsername]).keys,
privateKeys: [privKeyObj] // FOR SIGNING
};
@@ -303,8 +303,6 @@ function InitializeChatServer() {
EncryptedWithKeyOfUsername: ReceiversUsername,
Message: EncryptedMessage
}));
- ChatTextInput.val("");
- ChatTextInput.val("");
});
}
} else {
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/imageCaching.js b/main/app/sprinkles/core/assets/SiteAssets/js/imageCaching.js
deleted file mode 100644
index ee11c70..0000000
--- a/main/app/sprinkles/core/assets/SiteAssets/js/imageCaching.js
+++ /dev/null
@@ -1,132 +0,0 @@
-;(function ($) {
- function jQueryImageCaching(params) {
- var ImageCaching = {
- selector: 'img',
- debugMode: false,
- cachingKeyAttribute: 'data-caching-key',
- sourceKeyAttribute: 'data-src',
- renderCallback: null,
- crossOrigin: 'Anonymous',
- init: function (params) {
- ImageCaching.log('Initialization of ImageCaching');
- for (var param in params) {
- ImageCaching[param] = params[param];
- console.log("%c[CACHE LOGGER] Image caching initialized for " + params[param]['selector'] + "!", "color: brown;");
- }
-
- $(ImageCaching.selector).each(function () {
- ImageCaching.applyToImage($(this));
- });
- },
- getCookie(cookie) {
- var value = "; " + document.cookie;
- var parts = value.split("; " + cookie + "=");
- if (parts.length === 2) return parts.pop().split(";").shift();
- },
- getCacheKey: function (element) {
- if (element.attr(ImageCaching.cachingKeyAttribute)) {
- return element.attr(ImageCaching.cachingKeyAttribute);
- } else {
- return element.attr(ImageCaching.sourceKeyAttribute);
- }
- },
- getCache: function (element) {
- var key = this.getCacheKey(element);
- return this.getCookie(key);
- },
- setCache: function (element, imageData) {
- var key = ImageCaching.getCacheKey(element);
- ImageCaching.log('Set cache', key, imageData, element);
- document.cookie = key + "=" + encodeURIComponent(imageData) + "; expires=Mon, 18 Dec 2102 04:48:00 CEST; path=/"; // save image data
- return true;
- },
- removeCache: function (element) {
- var key = ImageCaching.getCacheKey(element);
- ImageCaching.log('Remove cache', key);
- document.cookie = key + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"; // delete image data
- return true;
- },
- renderImage: function (element, picture) {
- ImageCaching.log('Rendering...', picture, element);
- element.attr('src', picture);
-
- if (this.renderCallback) {
- ImageCaching.log('Render Callback...', element);
- this.renderCallback(picture, element);
- }
- },
- applyToImage: function (element, force) {
- var cache = null;
- if (!force) {
- cache = this.getCache(element);
- }
-
- if (cache) {
- ImageCaching.log('Image from cache', element);
- this.renderImage(element, cache);
- } else {
- var sourceLink = element.attr(ImageCaching.sourceKeyAttribute);
- var getParamPrefix = "?";
- if (sourceLink.indexOf('?') > 0) {
- getParamPrefix = "&";
- }
- sourceLink += getParamPrefix + 'cacheTime=' + Date.now();
-
- ImageCaching.log('Request to: ' + sourceLink, element);
-
- var img = new Image();
-
- if (ImageCaching.crossOrigin) {
- img.setAttribute('crossOrigin', 'Anonymous');
- }
-
- img.onload = function () {
- ImageCaching.log('Loading completed', img);
- var canvas = document.createElement('canvas');
- canvas.width = img.width;
- canvas.height = img.height;
-
- // Copy the image contents to the canvas
- var ctx = canvas.getContext("2d");
- ctx.drawImage(img, 0, 0);
-
- var imageData = canvas.toDataURL("image/png");
- ImageCaching.setCache(element, imageData);
- ImageCaching.renderImage(element, imageData);
- };
- img.src = sourceLink;
- }
- },
- refresh: function (itemsSelector) {
- var selector = null;
- if (itemsSelector) {
- selector = itemsSelector;
- } else {
- selector = ImageCaching.selector;
- }
-
- $(selector).each(function () {
- ImageCaching.applyToImage($(this), true);
- });
-
- },
- log: function () {
- if (this.debugMode) {
- console.log(arguments);
- }
- }
-
- };
- ImageCaching.init(params);
- return ImageCaching;
- }
-
- $.fn.extend({
- imageCaching: function (options) {
- var params = {selector: this};
- params = $.extend(params, options);
-
- return new jQueryImageCaching(params);
- }
- });
-})(jQuery);
\ No newline at end of file
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/main.js b/main/app/sprinkles/core/assets/SiteAssets/js/main.js
index 33716b5..0a991fc 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/js/main.js
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/main.js
@@ -37,62 +37,6 @@ function triggerErrorPopup(ErrorCode) {
});
}
-/**
- * ENCRYPTION
- */
-/*var openpgp = window.openpgp;
-var options, EncryptedText, DecryptedText, PrivateKey, PassPhrase, PrivateKeyObj;
-var PublicKey = [];
-openpgp.initWorker({path: '/assets-raw/core/assets/SiteAssets/js/openpgp.worker.js'});
-
-$.ajax({
- type: 'GET',
- url: site.uri.public + '/api/users/u/' + current_username + '/publickey',
- dataType : "json",
- success: function (response) {
- if (response.user_id === current_user_id) {
- PublicKey[current_username] = response.PublicKey;
- PrivateKey = localStorage.getItem("PrivateKey");
- PassPhrase = localStorage.getItem("🔒")
- }
- }
-});
-
-function EncryptMessage(Message, Username) {
- if (!Username in PublicKey) {
- $.ajax({
- type: 'GET',
- url: site.uri.public + '/api/users/u/' + Username + '/publickey',
- dataType : "json",
- success: function (response) {
- if (response.user_id === current_user_id) {
- PublicKey[Username] = response.PublicKey;
- }
- }
- });
- }
- options = {
- data: Message,
- publicKeys: openpgp.key.readArmored(PublicKey[Username]).keys
- };
- openpgp.encrypt(options).then(function (EncryptedText) {
- EncryptedText = EncryptedText.data;
- });
-}
-
-function DecryptMessage(EncryptedText) {
- PrivateKeyObj = openpgp.key.readArmored(PrivateKey).keys[0];
- PrivateKeyObj.decrypt(PassPhrase);
- options = {
- message: openpgp.message.readArmored(EncryptedText),
- privateKeys: [PrivateKeyObj]
- };
-
- openpgp.decrypt(options).then(function (DecryptedText) {
- DecryptedText = DecryptedText.data;
- });
-}*/
-
/**
* OLD BROWSER
* @type {boolean}
@@ -150,10 +94,6 @@ MainTabWindows.on('beforeChange', function (event, slick, currentSlide, nextSlid
currentSlide.children().attr("src", (currentSlide.children().attr("src").split('.svg')[0].replace('Activated', '') + ".svg"));
nextSlide.children().attr("src", nextSlide.children().attr("src").split('.svg')[0] + "Activated.svg");
- //currentSlide.children().attr("data-src", (currentSlide.children().attr("data-src").split('.svg')[0].replace('Activated', '') + ".svg"));
- //nextSlide.children().attr("data-caching-key", nextSlide.children().attr("data-src").split('.svg')[0].split('/').pop() + "Activated_nav_cached");
- //nextSlide.children().attr("data-src", nextSlide.children().attr("data-src").split('.svg')[0] + "Activated.svg");
- //cachedNavbarIcons.refresh();
$el = nextSlide;
$el.addClass("ActiveTab");
leftPos = $el.position().left;
@@ -179,10 +119,7 @@ UserSearchBar.keyup(function () {
//var RandomGifUrl = GifUrls[RandomGif];
//console.image(RandomGifUrl, 0.5);
- alerts.ufAlerts().ufAlerts('fetch');
-
SearchResults.append("
" + answer.full_name + "
");
- //$(".SearchResults .Avatar").imageCaching(); // refresh
},
error: function () {
console.log("%c[SEARCH LOGGER] User " + RequestedUser + " was not found!", "color: red");
@@ -206,7 +143,7 @@ $(document).ready(function () {
})
},
error: function () {
- console.log("%c[SEARCH LOGGER] User " + RequestedUser + " was not found!", "color: red");
+ console.log("%c[FRIENDLY LOGGER] No friends were found! :(", "color: red");
alerts.ufAlerts().ufAlerts('fetch');
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/popups.js b/main/app/sprinkles/core/assets/SiteAssets/js/popups.js
index 00851d6..7980509 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/js/popups.js
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/popups.js
@@ -1625,7 +1625,7 @@
return new Promise(function (resolve, reject) {
// functions to handle all resolving/rejecting/settling
var succeedWith = function succeedWith(value) {
- constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); // TODO: make closePopup an *instance* method
+ constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); // O: make closePopup an *instance* method
if (innerParams.useRejections) {
resolve(value);
} else {
@@ -1682,7 +1682,7 @@
var confirm = function confirm(value) {
if (innerParams.showLoaderOnConfirm) {
- constructor.showLoading(); // TODO: make showLoading an *instance* method
+ constructor.showLoading(); // make showLoading an *instance* method
}
if (innerParams.preConfirm) {
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php
index ddb7c7b..df7580d 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php
@@ -5,7 +5,7 @@ namespace Ratchet;
/**
* Wraps ConnectionInterface objects via the decorator pattern but allows
* parameters to bubble through with magic methods
- * @todo It sure would be nice if I could make most of this a trait...
+ * It sure would be nice if I could make most of this a trait...
*/
abstract class AbstractConnectionDecorator implements ConnectionInterface
{
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php
index f83b273..2f42a11 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php
@@ -10,7 +10,7 @@ interface WsServerInterface
/**
* If any component in a stack supports a WebSocket sub-protocol return each supported in an array
* @return array
- * @todo This method may be removed in future version (note that will not break code, just make some code obsolete)
+ * @odo This method may be removed in future version (note that will not break code, just make some code obsolete)
*/
function getSubProtocols();
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php
index 0f427fe..7f877ff 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php
@@ -36,7 +36,6 @@ class WampServerTest extends AbstractMessageComponentTestCase
}
public function testGetSubProtocols() {
- // todo: could expand on this
$this->assertInternalType('array', $this->_serv->getSubProtocols());
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php
index ab21e27..2a73f25 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php
@@ -104,7 +104,7 @@ class BufferStream implements StreamInterface
public function write($string) {
$this->buffer .= $string;
- // TODO: What should happen here?
+ // What should happen here?
if (strlen($this->buffer) >= $this->hwm) {
return FALSE;
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php
index 680a16c..45cdc32 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php
@@ -19,7 +19,7 @@ use Assetic\Filter\FilterInterface;
* Applies a filter to an asset based on a source and/or target path match.
*
* @author Kris Wallsmith
- * @todo A better asset-matcher mechanism
+ * A better asset-matcher mechanism
*/
class EnsureFilterWorker implements WorkerInterface
{
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php
index 40e3941..ffc7e9e 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php
@@ -290,14 +290,13 @@ class CompassFilter extends BaseSassFilter
if (NULL !== $this->scss) {
$type = $this->scss ? 'scss' : 'sass';
} else if ($path = $asset->getSourcePath()) {
- // FIXME: what if the extension is something else?
$type = pathinfo($path, PATHINFO_EXTENSION);
} else {
$type = 'scss';
}
$tempName = tempnam($tempDir, 'assetic_compass');
- unlink($tempName); // FIXME: don't use tempnam() here
+ unlink($tempName);
// input
$input = $tempName . '.' . $type;
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php
index da9a61a..d537dee 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php
@@ -126,7 +126,7 @@ class CssEmbedFilter extends BaseProcessFilter implements DependencyExtractorInt
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php
index 3939bfe..dc4797c 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php
@@ -98,7 +98,7 @@ class CssImportFilter extends BaseCssFilter implements DependencyExtractorInterf
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php
index 4532cdd..3f5a817 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php
@@ -153,8 +153,8 @@ EOF;
}
/**
- * @todo support for import-once
- * @todo support for import (less) "lib.css"
+ * support for import-once
+ * support for import (less) "lib.css"
*/
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
$loadPaths = $this->loadPaths;
@@ -170,7 +170,7 @@ EOF;
foreach (LessUtils::extractImports($content) as $reference) {
if ('.css' === substr($reference, -4)) {
// skip normal css imports
- // todo: skip imports with media queries
+ // skip imports with media queries
continue;
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php
index 5424655..181db96 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php
@@ -130,7 +130,7 @@ class LessphpFilter implements DependencyExtractorInterface
foreach (LessUtils::extractImports($content) as $reference) {
if ('.css' === substr($reference, -4)) {
// skip normal css imports
- // todo: skip imports with media queries
+ // skip imports with media queries
continue;
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php
index dd41eb6..1c1d667 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php
@@ -42,7 +42,7 @@ class PhpCssEmbedFilter implements DependencyExtractorInterface
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php
index f841d6f..b5cc5af 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php
@@ -74,7 +74,7 @@ class RooleFilter extends BaseNodeFilter implements DependencyExtractorInterface
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php
index 7d1e7fb..714a112 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php
@@ -34,7 +34,7 @@ abstract class BaseSassFilter extends BaseProcessFilter implements DependencyExt
foreach (SassUtils::extractImports($content) as $reference) {
if ('.css' === substr($reference, -4)) {
// skip normal css imports
- // todo: skip imports with media queries
+ // skip imports with media queries
continue;
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php
index b1d8610..69a83cf 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php
@@ -120,7 +120,7 @@ EOF;
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php
index bca2206..b7a44fa 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php
@@ -114,7 +114,7 @@ EOF;
}
public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) {
- // todo
+
return array();
}
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php
index 0f0b58e..b80769a 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php
@@ -6,7 +6,7 @@ use Psr\Http\Message\RequestInterface;
/**
* A standard interface for interacting with the various version of the WebSocket protocol
- * @todo Look in to extension support
+ * Look in to extension support
*/
interface NegotiatorInterface
{
@@ -42,7 +42,7 @@ interface NegotiatorInterface
* If enabled and support for a subprotocol has been added handshake
* will not upgrade if a match between request and supported subprotocols
* @param boolean $enable
- * @todo Consider extending this interface and moving this there.
+ * Consider extending this interface and moving this there.
* The spec does says the server can fail for this reason, but
* it is not a requirement. This is an implementation detail.
*/
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php
index 7a8660a..59b9bcc 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php
@@ -7,7 +7,7 @@ use Psr\Http\Message\RequestInterface;
/**
* These are checks to ensure the client requested handshake are valid
* Verification rules come from section 4.2.1 of the RFC6455 document
- * @todo Currently just returning invalid - should consider returning appropriate HTTP status code error #s
+ * Currently just returning invalid - should consider returning appropriate HTTP status code error #s
*/
class RequestVerifier
{
@@ -74,7 +74,7 @@ class RequestVerifier
/**
* @param array $hostHeader
* @return bool
- * @todo Once I fix HTTP::getHeaders just verify this isn't NULL or empty...or maybe need to verify it's a valid domain??? Or should it equal $_SERVER['HOST'] ?
+ * Once I fix HTTP::getHeaders just verify this isn't NULL or empty...or maybe need to verify it's a valid domain??? Or should it equal $_SERVER['HOST'] ?
*/
public function verifyHost(array $hostHeader) {
return (1 === count($hostHeader));
@@ -113,8 +113,8 @@ class RequestVerifier
* This function verifies the nonce is valid (64 big encoded, 16 bytes random string)
* @param array $keyHeader
* @return bool
- * @todo The spec says we don't need to base64_decode - can I just check if the length is 24 and not decode?
- * @todo Check the spec to see what the encoding of the key could be
+ * The spec says we don't need to base64_decode - can I just check if the length is 24 and not decode?
+ * Check the spec to see what the encoding of the key could be
*/
public function verifyKey(array $keyHeader) {
return (1 === count($keyHeader) && 16 === strlen(base64_decode($keyHeader[0])));
@@ -130,13 +130,13 @@ class RequestVerifier
}
/**
- * @todo Write logic for this method. See section 4.2.1.8
+ * Write logic for this method. See section 4.2.1.8
*/
public function verifyProtocol($val) {
}
/**
- * @todo Write logic for this method. See section 4.2.1.9
+ * Write logic for this method. See section 4.2.1.9
*/
public function verifyExtensions($val) {
}
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php
index 8ef854c..e8273a4 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php
@@ -7,7 +7,7 @@ use GuzzleHttp\Psr7\Response;
/**
* The latest version of the WebSocket protocol
- * @todo Unicode: return mb_convert_encoding(pack("N",$u), mb_internal_encoding(), 'UCS-4BE');
+ * Unicode: return mb_convert_encoding(pack("N",$u), mb_internal_encoding(), 'UCS-4BE');
*/
class ServerNegotiator implements NegotiatorInterface
{
@@ -129,7 +129,7 @@ class ServerNegotiator implements NegotiatorInterface
* If enabled and support for a subprotocol has been added handshake
* will not upgrade if a match between request and supported subprotocols
* @param boolean $enable
- * @todo Consider extending this interface and moving this there.
+ * Consider extending this interface and moving this there.
* The spec does says the server can fail for this reason, but
* it is not a requirement. This is an implementation detail.
*/
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/Frame.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/Frame.php
index 62f5446..ac019c3 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/Frame.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/Frame.php
@@ -313,7 +313,7 @@ class Frame implements FrameInterface
return $payload ^ str_pad('', $len, $maskingKey, STR_PAD_RIGHT);
- // TODO: Remove this before publish - keeping methods here to compare performance (above is faster but need control against v0.3.3)
+ // Remove this before publish - keeping methods here to compare performance (above is faster but need control against v0.3.3)
$applied = '';
for ($i = 0, $len = strlen($payload); $i < $len; $i++) {
@@ -424,7 +424,7 @@ class Frame implements FrameInterface
/**
* {@inheritdoc}
- * @todo Consider not checking mask, always returning the payload, masked or not
+ * Consider not checking mask, always returning the payload, masked or not
*/
public function getPayload() {
if (!$this->isCoalesced()) {
@@ -436,7 +436,7 @@ class Frame implements FrameInterface
/**
* Get the raw contents of the frame
- * @todo This is untested, make sure the substr is right - trying to return the frame w/o the overflow
+ * This is untested, make sure the substr is right - trying to return the frame w/o the overflow
*/
public function getContents() {
return substr($this->data, 0, $this->getPayloadStartingByte() + $this->getPayloadLength());
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php
index 39edd11..59884b2 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php
@@ -6,8 +6,8 @@ use Ratchet\RFC6455\Messaging\Frame;
/**
* @covers Ratchet\RFC6455\Messaging\Frame
- * @todo getMaskingKey, getPayloadStartingByte don't have tests yet
- * @todo Could use some clean up in general, I had to rush to fix a bug for a deadline, sorry.
+ * getMaskingKey, getPayloadStartingByte don't have tests yet
+ * Could use some clean up in general, I had to rush to fix a bug for a deadline, sorry.
*/
class FrameTest extends \PHPUnit_Framework_TestCase
{
@@ -260,7 +260,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider UnframeMessageProvider
* covers Ratchet\RFC6455\Messaging\Frame::getPayloadLength
- * @todo Not yet testing when second additional payload length descriptor
+ * Not yet testing when second additional payload length descriptor
*/
public function testGetPayloadLengthFromFullMessage($msg, $encoded) {
$this->_frame->addBuffer(base64_decode($encoded));
@@ -279,7 +279,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider maskingKeyProvider
* covers Ratchet\RFC6455\Messaging\Frame::getMaskingKey
- * @todo I I wrote the dataProvider incorrectly, skipping for now
+ * I I wrote the dataProvider incorrectly, skipping for now
*/
public function testGetMaskingKey($mask) {
$this->_frame->addBuffer(static::encode($this->_firstByteFinText));
@@ -299,7 +299,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider UnframeMessageProvider
* covers Ratchet\RFC6455\Messaging\Frame::getPayload
- * @todo Move this test to bottom as it requires all methods of the class
+ * Move this test to bottom as it requires all methods of the class
*/
public function testUnframeFullMessage($unframed, $base_framed) {
$this->_frame->addBuffer(base64_decode($base_framed));
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php
index c82a370..7642c87 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php
@@ -119,7 +119,7 @@ class FunctionResolveTest extends TestCase
public function shouldSupportVeryDeepNestedPromises() {
$deferreds = [];
- // @TODO Increase count once global-queue is merged
+ // Increase count once global-queue is merged
for ($i = 0; $i < 10; $i++) {
$deferreds[] = $d = new Deferred();
$p = $d->promise();
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php
index 8e2a250..17b9ec4 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php
@@ -72,7 +72,7 @@ class StreamEncryption
// pause actual stream instance to continue operation on raw stream socket
$stream->pause();
- // TODO: add write() event to make sure we're not sending any excessive data
+ // add write() event to make sure we're not sending any excessive data
$deferred = new Deferred(function ($_, $reject) use ($toggle) {
// cancelling this leaves this stream in an inconsistent state…
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
index d2a1230..bc8a096 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -429,7 +429,7 @@ class PdoSessionHandler extends AbstractSessionHandler
*
* @return string
*
- * @todo implement missing support for oci DSN (which look totally different from other PDO ones)
+ * implement missing support for oci DSN (which look totally different from other PDO ones)
*/
private function buildDsnFromUrl($dsnOrUrl) {
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
@@ -652,7 +652,7 @@ class PdoSessionHandler extends AbstractSessionHandler
*
* @throws \DomainException When an unsupported PDO driver is used
*
- * @todo implement missing advisory locks
+ * implement missing advisory locks
* - for oci using DBMS_LOCK.REQUEST
* - for sqlsrv using sp_getapplock with LockOwner = Session
*/
diff --git a/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE.css b/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE.css
index 38fe523..dfe6b4b 100644
--- a/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE.css
+++ b/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE.css
@@ -2233,7 +2233,7 @@ a:focus {
font-size: 12px;
}
-/* Widget: TODO LIST */
+/* Widget:*/
.todo-list {
margin: 0;
padding: 0;
diff --git a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js
index 8f31ca5..0bdfc9d 100644
--- a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js
+++ b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js
@@ -709,12 +709,11 @@ function _init() {
})(jQuery);
/*
- * TODO LIST CUSTOM PLUGIN
+ LIST CUSTOM PLUGIN
* -----------------------
* This plugin depends on iCheck plugin for checkbox and radio inputs
*
* @type plugin
- * @usage $("#todo-widget").todolist( options );
*/
(function ($) {
diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js
index 3724ef7..06fcc43 100644
--- a/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js
+++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js
@@ -29,7 +29,7 @@
* UserFrosting https://www.userfrosting.com
* @author Alexander Weissman
*
- * @todo Implement proper fallback for when `set` function isn't supported by FormData.
+ * Implement proper fallback for when `set` function isn't supported by FormData.
*/
;(function ($, window, document, undefined) {
'use strict';
@@ -166,7 +166,7 @@
console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText);
}
// Display errors on failure
- // TODO: ufAlerts widget should have a 'destroy' method
+ // ufAlerts widget should have a 'destroy' method
if (!this.settings.msgTarget.data('ufAlerts')) {
this.settings.msgTarget.ufAlerts();
} else {
diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js
index 588c40b..221a2fc 100644
--- a/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js
+++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js
@@ -82,7 +82,7 @@
console.log("Error (" + data.status + "): " + data.responseText);
}
// Display errors on failure
- // TODO: ufAlerts widget should have a 'destroy' method
+ // ufAlerts widget should have a 'destroy' method
if (!base.options.msgTarget.data('ufAlerts')) {
base.options.msgTarget.ufAlerts();
} else {
diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js
index 692dccc..8981bb3 100644
--- a/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js
+++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js
@@ -551,7 +551,7 @@
console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText);
}
// Display errors on failure
- // TODO: ufAlerts widget should have a 'destroy' method
+ // ufAlerts widget should have a 'destroy' method
if (!this.settings.msgTarget.data('ufAlerts')) {
this.settings.msgTarget.ufAlerts();
} else {
diff --git a/main/app/sprinkles/core/src/Controller/CoreController.php b/main/app/sprinkles/core/src/Controller/CoreController.php
index f78d4c1..4bacef2 100644
--- a/main/app/sprinkles/core/src/Controller/CoreController.php
+++ b/main/app/sprinkles/core/src/Controller/CoreController.php
@@ -29,10 +29,6 @@ class CoreController extends SimpleController
*/
public function pageIndex($request, $response, $args) {
- $FeedImages = DB::table('image_posts')
- ->orderBy('Created')
- ->get();
-
// AUTHORIZATION - ONLY FOR ADMINS RIGHT KNOW (BUILD PROCESS)
$authorizer = $this->ci->authorizer;
$currentUser = $this->ci->currentUser;
@@ -40,9 +36,7 @@ class CoreController extends SimpleController
//throw new ForbiddenException();
}
- return $this->ci->view->render($response, 'pages/index.html.twig', [
- 'FeedImages' => $FeedImages
- ]);
+ return $this->ci->view->render($response, 'pages/index.html.twig');
}
diff --git a/main/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php b/main/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php
index 71c1c4c..3a321e4 100644
--- a/main/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php
+++ b/main/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php
@@ -74,7 +74,7 @@ trait Unique
/**
* Set the "offset" value of the query.
*
- * @todo Implement for 'unionOffset' as well? (By checking the value of $this->query->getQuery()->unions)
+ * Implement for 'unionOffset' as well? (By checking the value of $this->query->getQuery()->unions)
* @see \Illuminate\Database\Query\Builder
* @param int $value
* @return $this
@@ -98,7 +98,7 @@ trait Unique
/**
* Set the "limit" value of the query.
*
- * @todo Implement for 'unionLimit' as well? (By checking the value of $this->query->getQuery()->unions)
+ * Implement for 'unionLimit' as well? (By checking the value of $this->query->getQuery()->unions)
* @see \Illuminate\Database\Query\Builder
* @param int $value
* @return $this
diff --git a/main/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php b/main/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php
index 2ef6588..4113470 100644
--- a/main/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php
+++ b/main/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php
@@ -165,7 +165,7 @@ class WhoopsRenderer extends ErrorRenderer
public function render() {
if (!$this->handleUnconditionally()) {
// Check conditions for outputting HTML:
- // @todo: Make this more robust
+ // : Make this more robust
if (php_sapi_name() === 'cli') {
// Help users who have been relying on an internal test value
// fix their code to the proper method
@@ -221,7 +221,7 @@ class WhoopsRenderer extends ErrorRenderer
$vars = [
"page_title" => $this->getPageTitle(),
- // @todo: Asset compiler
+ // : Asset compiler
"stylesheet" => file_get_contents($cssFile),
"zepto" => file_get_contents($zeptoFile),
"clipboard" => file_get_contents($clipboard),
@@ -269,7 +269,7 @@ class WhoopsRenderer extends ErrorRenderer
}
// Add extra entries list of data tables:
- // @todo: Consolidate addDataTable and addDataTableCallback
+ // : Consolidate addDataTable and addDataTableCallback
$extraTables = array_map(function ($table) use ($inspector) {
return $table instanceof \Closure ? $table($inspector) : $table;
}, $this->getDataTables());
diff --git a/main/app/sprinkles/core/src/Mail/Mailer.php b/main/app/sprinkles/core/src/Mail/Mailer.php
index 82302b8..761d15a 100644
--- a/main/app/sprinkles/core/src/Mail/Mailer.php
+++ b/main/app/sprinkles/core/src/Mail/Mailer.php
@@ -64,7 +64,7 @@ class Mailer
}
// Set any additional message-specific options
- // TODO: enforce which options can be set through this subarray
+ // enforce which options can be set through this subarray
if (isset($config['message_options'])) {
$this->setOptions($config['message_options']);
}
diff --git a/main/app/sprinkles/core/src/Mail/TwigMailMessage.php b/main/app/sprinkles/core/src/Mail/TwigMailMessage.php
index e20b906..aa4daea 100644
--- a/main/app/sprinkles/core/src/Mail/TwigMailMessage.php
+++ b/main/app/sprinkles/core/src/Mail/TwigMailMessage.php
@@ -43,7 +43,7 @@ class TwigMailMessage extends MailMessage
$twig = $this->view->getEnvironment();
// Must manually merge in global variables for block rendering
- // TODO: should we keep this separate from the local parameters?
+ // should we keep this separate from the local parameters?
$this->params = $twig->getGlobals();
if ($filename !== NULL) {
diff --git a/main/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php b/main/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
index 27544c7..6ac8c41 100644
--- a/main/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
+++ b/main/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
@@ -124,7 +124,7 @@ class ServicesProvider
// Load Sprinkle assets
$sprinkles = $c->sprinkleManager->getSprinkleNames();
- // TODO: move this out into PathBuilder and Loader classes in userfrosting/assets
+ // move this out into PathBuilder and Loader classes in userfrosting/assets
// This would also allow us to define and load bundles in themes
$bundleSchemas = array_reverse($locator->findResources('sprinkles://' . $config['assets.raw.schema'], TRUE, TRUE));
@@ -176,7 +176,7 @@ class ServicesProvider
/**
* Middleware to check environment.
*
- * @todo We should cache the results of this, the first time that it succeeds.
+ * We should cache the results of this, the first time that it succeeds.
*/
$container['checkEnvironment'] = function ($c) {
$checkEnvironment = new CheckEnvironment($c->view, $c->locator, $c->cache);
@@ -279,7 +279,7 @@ class ServicesProvider
/**
* Initialize Eloquent Capsule, which provides the database layer for UF.
*
- * @todo construct the individual objects rather than using the facade
+ * construct the individual objects rather than using the facade
*/
$container['db'] = function ($c) {
$config = $c->config;
diff --git a/main/app/sprinkles/core/src/Sprunje/Sprunje.php b/main/app/sprinkles/core/src/Sprunje/Sprunje.php
index 840eff0..ea066a3 100644
--- a/main/app/sprinkles/core/src/Sprunje/Sprunje.php
+++ b/main/app/sprinkles/core/src/Sprunje/Sprunje.php
@@ -139,7 +139,7 @@ abstract class Sprunje
$v->rule('integer', 'page');
$v->rule('regex', 'format', '/json|csv/i');
- // TODO: translated rules
+ // translated rules
if (!$v->validate()) {
$e = new BadRequestException();
foreach ($v->errors() as $idx => $field) {
diff --git a/main/app/sprinkles/core/templates/pages/index.html.twig b/main/app/sprinkles/core/templates/pages/index.html.twig
index 9b21dd4..0479fb8 100644
--- a/main/app/sprinkles/core/templates/pages/index.html.twig
+++ b/main/app/sprinkles/core/templates/pages/index.html.twig
@@ -24,7 +24,7 @@
{% for FeedImage in FeedImages %}
+ alt="You probably don't have a permission to see this image.">
{% endfor %}
@@ -65,11 +65,9 @@