Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
feat(Editor): Support wysibb editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Aug 6, 2019
1 parent 9a18e20 commit c81b8c9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
- **gitignore:** Add ignore of `/backup` folder

### Feat
- **Category:** Add Categories Support when upload torrent
- **Category:** Add Image and class_name support
- **Category:** Add Default sprite image of category
- **Category:** Add Categories Manage Pane
- **Category:** Add Categories Support when upload torrent
- **Crontab:** Move From Timer to Process
- **Gravatar:** Add support of gravatar
- **Process:** Add custom Process Support
Expand Down
16 changes: 16 additions & 0 deletions apps/public/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ const paswordStrengthText = {
4: "Strong ☻" // very unguessable: strong protection from offline slow-hash scenario. (guesses >= 10^10)
};

const wysibbSetting = {
buttons: "bold,italic,underline,strike,sup,sub,|,img,link,|,bullist,numlist,smilebox,|,fontcolor,fontsize,fontfamily,|,justifyleft,justifycenter,justifyright,|,quote,code,table,removeFormat",
allButtons: {},
smileList: [
/* {img: '<img src="/static/pic/smilies/1.gif" class="sm">', bbcode:"[em]1[/em]"}, */
],
};

function humanFileSize(bytes, fix, si) {
let thresh = si ? 1000 : 1024;
if (Math.abs(bytes) < thresh) {
Expand Down Expand Up @@ -86,6 +94,14 @@ jQuery(document).ready(function () {
}
}

// Active Editor
$('textarea').click(function () {
let that = $(this);
if (that.hasClass('to-load-editor')) {
that.removeClass('to-load-editor').wysibb(wysibbSetting).addClass('loaded-editor');
}
});

// Captcha Img Re-flush
let captcha_img_another = $('.captcha_img');
captcha_img_another.on('click', function () {
Expand Down
4 changes: 3 additions & 1 deletion apps/views/layout/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<link rel="stylesheet" href="/lib/flag-css/dist/css/flag-css.min.css">
<link rel="stylesheet" href="/lib/fontAwesome/css/all.min.css">
<link rel="stylesheet" href="/lib/zui/dist/css/zui.min.css">
<link rel="stylesheet" href="/lib/jqjquery-wysibb/theme/default/wbbtheme.css">

<!-- Custom styles of this template -->
<link rel="stylesheet" href="/static/css/main.css?<?= $css_tag ?>">
Expand Down Expand Up @@ -110,10 +111,11 @@
<?= $this->section('body') ?>

<!-- Javascript of Library -->
<script src="/lib/localforage/dist/localforage.min.js"></script>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="/lib/zui/dist/js/zui.min.js"></script>
<script src="/lib/jqjquery-wysibb/jquery.wysibb.js"></script>
<script src="/lib/bootstrap-validator/dist/validator.min.js"></script>
<script src="/lib/localforage/dist/localforage.min.js"></script>
<script src="/lib/jquery.textarea.autoresize/js/jquery.textarea.autoresize.js"></script>

<!-- Custom Javascript of this template -->
Expand Down
2 changes: 1 addition & 1 deletion apps/views/torrent/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<tr>
<td class="nowrap"><label for="descr" class="required">Description</label></td>
<td>
<textarea id="descr" name="descr" class="form-control" style="width: 99%"
<textarea id="descr" name="descr" class="form-control to-load-editor" style="width: 99%"
cols="100" rows="10"></textarea>
</td>
</tr>
Expand Down
9 changes: 5 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
"tests"
],
"dependencies": {
"zui": "^1.9.1",
"fontAwesome": "^5.6.3",
"jqjquery-wysibb": "^1.5.1",
"flag-css": "^0.0.12",
"html5shiv": "^3.7.3",
"respond": "^1.4.2",
"flag-css": "^0.0.12",
"zxcvbn": "^4.4.2",
"bootstrap-validator": "^0.11.9",
"localforage": "^1.7.3",
"jquery": "2.2.4",
"zui": "^1.9.1",
"jqjquery-wysibb": "^1.5.1",
"bootstrap-validator": "^0.11.9",
"jquery.textarea.autoresize": "^0.1.1"
}
}

0 comments on commit c81b8c9

Please sign in to comment.