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 CreateGuid() { | |
| function _p8(s) { | |
| var p = (Math.random().toString(16) + "000000000").substr(2, 8); | |
| return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; | |
| } | |
| return _p8() + _p8(true) + _p8(true) + _p8(); | |
| } |
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
| $('.fa-times').on('click', function(){ | |
| $(this).closest('li').remove(); | |
| }); |
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
| 1. Create bucket in Amazon AWS/S3. Choose US Standard. | |
| 2. Add More Permissions => Grantee: Everyone; Check 'List' and 'Upload/Delete'. | |
| 3. Edit Bucket Policy. Edit CORS Configuration. See uploads.js gist for code. | |
| ****** | |
| 4. Add dropzone.js file, get contents from dropzone website. | |
| 5. Add 'require dropzone' to application.js file. | |
| 6. Add uploads.js file to hold dropzone code. See uploads.js gist for code. | |
| ****** | |
| 7. Add #primaryImage div to view. This will be the target for the dropzone. | |
| 8. Add 'process' method from uploads.js gist to controller. Add route for /process. |
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
| ****** NOTHING TO CHANGE HERE, JUST COPY AND PASTE INTO AWS *********** | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
| <CORSRule> | |
| <AllowedOrigin>*</AllowedOrigin> | |
| <AllowedMethod>GET</AllowedMethod> | |
| <AllowedMethod>PUT</AllowedMethod> | |
| <AllowedMethod>POST</AllowedMethod> | |
| <MaxAgeSeconds>3000</MaxAgeSeconds> |
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
| $('#pleasantRT > .fa-folder').removeClass('opacity50'); |
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
| $('.catRow').on('click', function(){ | |
| var catEditing = $(this).html(); //All divs in row | |
| var catName = $(catEditing).closest('.catName').text(); | |
| alert(catName); | |
| }) | |
| For example, you are dynamically creating rows of data that are given from the DB. | |
| Each row is clickable. | |
| To find the Name (catName; i.e. 'category name') of the clicked row, use this code! |
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 SortJournalsWho(){ | |
| _selectedWho = $('#journalWhoTagSort option:selected').val(); | |
| $('.journalWho').each(function(){ | |
| if($(this).html()!=_selectedWho){ | |
| $(this).parent().addClass('displayNone'); | |
| } | |
| }); | |
| } | |
| function BuildCompletedJournals(data){ |
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 JournalScale(){ | |
| $('#journalScale').children('i').each(function(){ | |
| if(!$(this).hasClass('opacity50')){ | |
| _smileySelected = (this).id; | |
| } | |
| }); | |
| } |
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
| #accordion.panel-group | |
| .panel.panel-default.panelOne | |
| .panel-heading | |
| h4.panel-title | |
| a(data-toggle='collapse', data-parent='#accordion', href='#collapseOne') | |
| span.activityTitle#panelOneTitle | |
| #collapseOne.panel-collapse.collapse.in | |
| .panel-body | |
| h4.resource#panelOneResource |
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
| //add to your index page | |
| <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js"></script> | |
| // add to your JS file, for instance, on a click 'submit' button | |
| password = $('#password').val(); | |
| password = CryptoJS.MD5(password); |