### Install Project Dependencies Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Installs all development dependencies listed in the project's package.json file within the current project directory. ```Shell $ npm install ``` -------------------------------- ### Running Sample Web Server using Python Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/c3/README.md These commands navigate to the samples directory within the c3 repository and start a simple HTTP server using Python's built-in module. This allows you to view the provided examples locally in a web browser. ```shell $ cd c3/htdocs $ python -m SimpleHTTPServer 8080 ``` -------------------------------- ### Run Grunt Dev Server Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Executes the 'dev' Grunt task, starting a development server for the sample app and watching for file changes to trigger builds and tests. ```Shell grunt dev ``` -------------------------------- ### Installing Build Dependencies (npm) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/c3/CONTRIBUTING.md Explains how to install the remaining build dependencies for C3 using npm. This command should be run inside the cloned repository directory after installing Grunt CLI. ```npm npm install ``` -------------------------------- ### Installing EasyMDE via npm Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Command to install EasyMDE markdown editor as a project dependency using npm. ```Bash npm install easymde --save ``` -------------------------------- ### Installing SimpleMDE via npm Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Command to install the original SimpleMDE markdown editor as a project dependency using npm. ```Bash npm install simplemde --save ``` -------------------------------- ### Install ionic-modal-select via Bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ionic-modal-select/README.md Install the ionic-modal-select library using the Bower package manager. This command fetches the library files into your project. ```Shell bower install ionic-modal-select ``` -------------------------------- ### Installing Grunt CLI (npm) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/c3/CONTRIBUTING.md Explains how to install the Grunt command-line interface globally using npm. This is a prerequisite for building C3 and may require administrator privileges. ```npm npm install -g grunt-cli ``` -------------------------------- ### Install Grunt CLI Globally Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Installs the Grunt command-line interface globally using npm, which is required to run Grunt tasks from the terminal. ```Shell $ npm install -g grunt-cli ``` -------------------------------- ### Install Snackbar using Bower (Bash) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/snackbar/README.md Installs the Snackbar library using the Bower package manager. This command fetches the library and its dependencies. ```bash bower install snackbar ``` -------------------------------- ### Installing Node Dependencies - npm Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/CONTRIBUTING.md Installs all required Node.js dependencies for the project, typically listed in the package.json file. ```Shell npm install ``` -------------------------------- ### Install ngCordova using Bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngCordova/README.md This command uses the Bower package manager to install the ngCordova library into your project. Bower is a package manager for the web. ```Bash $ bower install ngCordova ``` -------------------------------- ### Installing Frontend Dependencies - npm Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/CONTRIBUTING.md Runs an npm script to install frontend dependencies, likely using Bower as indicated by the command name. ```Shell npm run bower ``` -------------------------------- ### Cloning C3 Repository (Git) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/c3/CONTRIBUTING.md Explains how to clone the C3 repository from GitHub and navigate into the project directory. Requires Git to be installed. ```git git clone https://github.com/masayuki0812/c3.git cd c3 ``` -------------------------------- ### Installing EasyMDE via CDN Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Include the EasyMDE CSS stylesheet and JavaScript library directly from the UNPKG CDN in your HTML file. ```HTML ``` -------------------------------- ### Example: Static Autolinker.link with Options - JavaScript Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Provides a concrete example of using the static Autolinker.link method with a string and an options object. It shows the expected output HTML. ```JavaScript var linkedText = Autolinker.link( "Check out google.com", { className: "myLink" } ); // Produces: "Check out google.com" ``` -------------------------------- ### Install Snackbar using NPM (Bash) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/snackbar/README.md Installs the Snackbar library using the Node Package Manager (NPM). This command fetches the library and its dependencies. ```bash npm install node-snackbar ``` -------------------------------- ### Installing SimpleMDE via CDN Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Include the SimpleMDE CSS stylesheet and JavaScript library directly from the jsDelivr CDN in your HTML file. ```HTML ``` -------------------------------- ### Initializing SimpleMDE with Custom Options - JavaScript Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md This snippet demonstrates how to create a new instance of the SimpleMDE editor, configuring many of its available options. It shows examples of setting basic options like autofocus and initial value, as well as more complex configurations for autosave, block styles, custom preview rendering (both synchronous and asynchronous), prompt texts, rendering settings, shortcuts, and a custom status bar item. ```JavaScript // Most options demonstrate the non-default behavior var simplemde = new SimpleMDE({ autofocus: true, autosave: { enabled: true, uniqueId: "MyUniqueID", delay: 1000, }, blockStyles: { bold: "__", italic: "_" }, element: document.getElementById("MyID"), forceSync: true, hideIcons: ["guide", "heading"], indentWithTabs: false, initialValue: "Hello world!", insertTexts: { horizontalRule: ["", "\n\n-----\n\n"], image: ["![](http://", ")"], link: ["[", "](http://)"], table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"], }, lineWrapping: false, minHeight: "500px", parsingConfig: { allowAtxHeaderWithoutSpace: true, strikethrough: false, underscoresBreakWords: true, }, placeholder: "Type here...", previewRender: function(plainText) { return customMarkdownParser(plainText); // Returns HTML from a custom parser }, previewRender: function(plainText, preview) { // Async method setTimeout(function(){ preview.innerHTML = customMarkdownParser(plainText); }, 250); return "Loading..."; }, promptURLs: true, promptTexts: { image: "Custom prompt for URL:", link: "Custom prompt for URL:", }, renderingConfig: { singleLineBreaks: false, codeSyntaxHighlighting: true, }, shortcuts: { drawTable: "Cmd-Alt-T" }, showIcons: ["code", "table"], spellChecker: false, status: false, status: ["autosave", "lines", "words", "cursor"], // Optional usage status: ["autosave", "lines", "words", "cursor", { className: "keystrokes", defaultValue: function(el) { this.keystrokes = 0; el.innerHTML = "0 Keystrokes"; }, onUpdate: function(el) { el.innerHTML = ++this.keystrokes + " Keystrokes"; } }] // Another optional usage, with a custom status bar item that counts keystrokes styleSelectedText: false, syncSideBySidePreviewScroll: false, tabSize: 4, toolbar: false, toolbarTips: false, }); ``` -------------------------------- ### Installing angular-elastic with NPM - Shell Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Provides the command line instruction to install the `angular-elastic` package using the npm package manager. ```Shell npm install angular-elastic ``` -------------------------------- ### Installing ngStorage with Bower (Bash) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngstorage/README.md Command to install the ngStorage module using the Bower package manager. Note the lowercase 'ngstorage'. ```bash bower install ngstorage ``` -------------------------------- ### Install angular-sanitize using bower (Shell) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-sanitize/README.md Command line instruction to install the angular-sanitize package using the bower package manager. ```shell bower install angular-sanitize ``` -------------------------------- ### Installing ngStorage with NPM (Bash) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngstorage/README.md Command to install the ngStorage module using the NPM package manager. Note the lowercase 'ngstorage'. ```bash npm install ngstorage ``` -------------------------------- ### Install Autolinker.js via Bower - Shell Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Installs the Autolinker.js library using the Bower package manager. The --save flag adds it as a dependency in the bower.json file. ```Shell bower install Autolinker.js --save ``` -------------------------------- ### Install Autolinker via npm - Shell Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Installs the Autolinker library using the Node Package Manager (npm). The --save flag adds it as a dependency in the package.json file. ```Shell npm install autolinker --save ``` -------------------------------- ### Installing angular-elastic with Bower - Shell Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Provides the command line instruction to install the `angular-elastic` package using the Bower package manager. ```Shell bower install angular-elastic ``` -------------------------------- ### Using socket.io-client in Node.js Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/socket.io-client/README.md Shows how to use socket.io-client in a Node.js environment. It requires installing the package via npm and then using `require` to import the library and connect to a server, setting up basic event listeners. ```JavaScript var socket = require('socket.io-client')('http://localhost'); socket.on('connect', function(){}); socket.on('event', function(data){}); socket.on('disconnect', function(){}); ``` -------------------------------- ### Install angular-sanitize using npm (Shell) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-sanitize/README.md Command line instruction to install the angular-sanitize package using the npm package manager. ```shell npm install angular-sanitize ``` -------------------------------- ### Install Latest Stable Ionic v1 with Bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ionic/README.md Installs the latest stable version of the Ionic Framework v1 using the Bower package manager. This command fetches the code from the `driftyco/ionic-bower` repository. ```shell bower install driftyco/ionic-bower ``` -------------------------------- ### Install angular-animate with bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-animate/README.md Installs the angular-animate package using the bower package manager, commonly used for front-end dependencies. ```shell bower install angular-animate ``` -------------------------------- ### Installing Material Design Icons with Bower (shell) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/material-design-icons-iconfont/README.md This command installs the `material-design-icons-iconfont` package using the Bower package manager. The `--save` flag adds the package as a dependency to the project's `bower.json` file. ```shell bower install material-design-icons-iconfont --save ``` -------------------------------- ### Install Trudesk on Ubuntu 20.04 Source: https://github.com/polonel/trudesk/blob/master/README.md This command downloads and executes an installation script for Trudesk Community Edition on an Ubuntu 20.04 system. It uses curl to fetch the script from storage.trudesk.io and pipes it directly to sudo bash for execution. ```Shell curl -L -s https://storage.trudesk.io/install/ubuntu-1.2.sh | sudo bash ``` -------------------------------- ### Calculate Date Difference with amDifference Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Calculates the difference between two dates using the amDifference filter, which wraps Moment.js's diff() method. The example shows how to get the difference in days between a creation date and the current date. ```HTML Scheduled {{message.createdAt | amDifference : null : 'days' }} days from now ``` -------------------------------- ### Add Time to Date with amAdd Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Adds a specified amount of time (hours, minutes, etc.) to a date using the amAdd filter. The example adds 1 hour and 30 minutes to a start time and formats the hour and minute separately. ```HTML Start time: {{day.start | amAdd : '1' : 'hours' | amDateFormat : 'hh'}} : {{day.start | amAdd : '30' : 'minutes' | amDateFormat : 'mm'}} ``` -------------------------------- ### Install Latest Nightly Ionic v1 with Bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ionic/README.md Installs the latest nightly build (from the master branch) of the Ionic Framework v1 using the Bower package manager. This command fetches the code from the `driftyco/ionic-bower` repository at the `master` branch. ```shell bower install driftyco/ionic-bower#master ``` -------------------------------- ### Install AngularJS via bower Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular/README.md Use this command to install the AngularJS library and its dependencies using the bower package manager. The library files will be placed in the bower_components directory. ```shell bower install angular ``` -------------------------------- ### Run Grunt Dist Task Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Executes the 'dist' Grunt task, performing a clean build and generating project documentation. ```Shell grunt dist ``` -------------------------------- ### Installing Material Design Icons with npm (shell) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/material-design-icons-iconfont/README.md This command installs the `material-design-icons-iconfont` package using the npm package manager. The `--save` flag adds the package as a dependency to the project's `package.json` file. ```shell npm install material-design-icons-iconfont --save ``` -------------------------------- ### Subtract Time from Date with amSubtract Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Subtracts a specified amount of time (hours, minutes, etc.) from a date using the amSubtract filter. The example subtracts 1 hour and 30 minutes from a start time and formats the hour and minute separately. ```HTML Start time: {{day.start | amSubtract : '1' : 'hours' | amDateFormat : 'hh'}} : {{day.start | amSubtract : '30' : 'minutes' | amDateFormat : 'mm'}} ``` -------------------------------- ### Install AngularJS via npm Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular/README.md Use this command to install the AngularJS library and its dependencies using the npm package manager. The library files will be placed in the node_modules directory. ```shell npm install angular ``` -------------------------------- ### Run Grunt Build Task Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Executes the 'build' Grunt task, performing a standard build of the project. ```Shell grunt build ``` -------------------------------- ### Run Default Grunt Build Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/CONTRIBUTING.md Executes the default Grunt task, typically performing a normal build, running JSHint, and executing Karma tests. ```Shell grunt ``` -------------------------------- ### Using SimpleMDE Utility Methods (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Provides examples of useful SimpleMDE utility methods to check the editor's state, such as whether preview, side-by-side, or fullscreen modes are active, and how to clear autosaved values. ```JavaScript var simplemde = new SimpleMDE(); simplemde.isPreviewActive(); // returns boolean simplemde.isSideBySideActive(); // returns boolean simplemde.isFullscreenActive(); // returns boolean simplemde.clearAutosavedValue(); // no returned value ``` -------------------------------- ### Accessing Bound Storage in HTML (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngstorage/README.md Example of how to read and write values from the $localStorage service when it has been bound to $scope.$storage in the controller. ```html ``` -------------------------------- ### Getting EasyMDE Editor Content Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Retrieve the current Markdown content from the EasyMDE editor instance using the value() method without arguments. ```JavaScript easyMDE.value(); ``` -------------------------------- ### Getting SimpleMDE Editor Content Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Retrieve the current Markdown content from the SimpleMDE editor instance using the value() method without arguments. ```JavaScript simplemde.value(); ``` -------------------------------- ### Include angular-sanitize script with bower (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-sanitize/README.md HTML script tag to include the angular-sanitize library in your web page after installing it using bower. ```html ``` -------------------------------- ### Include AngularJS in HTML (bower) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular/README.md Add this script tag to your HTML file to include the AngularJS library after installing it via bower. The path points to the file within the bower_components directory. ```html ``` -------------------------------- ### Customize SimpleMDE Keyboard Shortcuts (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Illustrates how to modify default keyboard shortcuts or define new ones for SimpleMDE actions using the 'shortcuts' configuration option. Shows examples of changing, unbinding, and adding shortcuts. ```JavaScript var simplemde = new SimpleMDE({ shortcuts: { "toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList "toggleCodeBlock": null, // unbind Ctrl-Alt-C "drawTable": "Cmd-Alt-T" // bind Cmd-Alt-T to drawTable action, which doesn't come with a default shortcut } }); ``` -------------------------------- ### Include angular-animate script tag (bower) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-animate/README.md Includes the angular-animate JavaScript file in an HTML document using a script tag, assuming it was installed via bower and placed in the default bower_components directory. ```html ``` -------------------------------- ### Set Date to Start of Unit with amStartOf Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Mutates a date object to the start of a specified unit of time (e.g., 'month', 'day') using the amStartOf filter, then converts it to the local timezone. Wraps Moment.js's startOf() method. ```HTML {{ date | amStartOf:'month' | amLocal }} ``` -------------------------------- ### Include AngularJS in HTML (npm) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular/README.md Add this script tag to your HTML file to include the AngularJS library after installing it via npm. The path points to the file within the node_modules directory. ```html ``` -------------------------------- ### Require AngularJS in JavaScript (npm) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular/README.md Use this line in your JavaScript code to import the AngularJS library when using a module system (like CommonJS) after installing via npm. ```javascript require('angular') ``` -------------------------------- ### Using socket.io-client in Browser HTML Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/socket.io-client/README.md Demonstrates how to include the socket.io-client library in an HTML page and establish a basic connection to a server, setting up listeners for `connect`, `event`, and `disconnect` events. Requires the server to expose the client library at `/socket.io/socket.io.js`. ```HTML ``` -------------------------------- ### Add ngAnimate dependency using require (npm) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-animate/README.md Adds 'ngAnimate' as a dependency to an AngularJS module using the require syntax, typically used in module bundlers like Webpack or Browserify after installing via npm. ```javascript angular.module('myApp', [require('angular-animate')]); ``` -------------------------------- ### Include angular-sanitize dependency with bower (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-sanitize/README.md JavaScript code snippet demonstrating how to declare 'ngSanitize' as a dependency for an AngularJS module when the library is included via a script tag (e.g., after installing with bower). ```javascript angular.module('myApp', ['ngSanitize']); ``` -------------------------------- ### Setting Single Line Textarea - HTML Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Explains how to force a textarea to start as a single line by setting the `rows` attribute to `1` in conjunction with the `msd-elastic` directive. Requires the `monospaced.elastic` module dependency. ```HTML ``` -------------------------------- ### Add ngAnimate dependency using module name (bower) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-animate/README.md Adds 'ngAnimate' as a dependency to an AngularJS module using its module name string, typically used after including the script tag in the HTML when installed via bower. ```javascript angular.module('myApp', ['ngAnimate']); ``` -------------------------------- ### Using amUtcOffset Filter with amDateFormat (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Shows how to use the amUtcOffset filter to display a date with a specific UTC offset. The example applies a '+0300' offset and then formats the result using the amDateFormat filter. Requires angular-moment 1.0.0-beta.3+. ```HTML {{message.date | amUtcOffset:'+0300' | amDateFormat:'MM.DD.YYYY HH:mm:ss'}} ``` -------------------------------- ### Providing Date for am-time-ago Directive (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Shows an example of how to define a date property (message.time) on the AngularJS scope within a controller. This date value is then used as the input for the am-time-ago directive in the corresponding view. ```JavaScript $scope.message = { text: 'hello world!', time: new Date() }; ``` -------------------------------- ### Binding a Specific Property of Object Options in ionic-modal-select Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ionic-modal-select/README.md Explains how to bind only a specific property of the selected object option to the `ng-model` using the `option-property` attribute. The example binds the 'name' property. ```html ``` -------------------------------- ### Running the C3 Build (Grunt) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/c3/CONTRIBUTING.md Explains how to run the Grunt build tool to compile C3. This command generates the final distribution files like c3.js, c3.min.js, c3.css, and c3.min.css. ```grunt grunt ``` -------------------------------- ### Modifying Autolinker.js Generated Tags Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md This snippet illustrates how to use the `replaceFn` in Autolinker.js to get an `Autolinker.HtmlTag` instance for a match. It shows how to modify the generated anchor tag by adding attributes (`rel`), classes (`external-link`), and changing the inner HTML before returning the modified tag. ```javascript var input = "..."; // string with URLs, Email Addresses, Mentions (Twitter, Instagram), and Hashtags var linkedText = Autolinker.link( input, { replaceFn : function( match ) { console.log( "href = ", match.getAnchorHref() ); console.log( "text = ", match.getAnchorText() ); var tag = match.buildTag(); // returns an `Autolinker.HtmlTag` instance for an tag tag.setAttr( 'rel', 'nofollow' ); // adds a 'rel' attribute tag.addClass( 'external-link' ); // adds a CSS class tag.setInnerHtml( 'Click here!' ); // sets the inner html for the anchor tag return tag; } } ); ``` -------------------------------- ### Format Duration with amDurationFormat Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Formats a duration value into a human-readable string using the amDurationFormat filter, which wraps Moment.js's humanize() method for durations. The example formats a duration given in minutes. ```HTML Message age: {{message.ageInMinutes | amDurationFormat : 'minute' }} ``` -------------------------------- ### Format Date with amDateFormat Filter (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Formats a date using the amDateFormat filter, which utilizes Moment.js's format() method. The example formats the time into a detailed string like 'Monday, October 7th 2013, 12:36:29 am'. ```HTML {{message.time | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a'}} ``` -------------------------------- ### Loading EasyMDE on First Textarea Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Initialize EasyMDE on the first ``` -------------------------------- ### Use a Pre-configured Autolinker.js Instance Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Demonstrates creating a single instance of Autolinker with specific configuration options (`newWindow`, `truncate`) and reusing that instance to process multiple strings, which is useful for dependency injection or consistent application of settings. ```javascript var autolinker = new Autolinker( { newWindow: false, truncate: 25 } ); //... autolinker.link( "Check out http://www.yahoo.com/some/long/path/to/a/file" ); // Produces: "Check out yahoo.com/some/long/pat.." //... autolinker.link( "Go to www.google.com" ); // Produces: "Go to google.com" ``` -------------------------------- ### Loading SimpleMDE on First Textarea Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Initialize SimpleMDE on the first ``` -------------------------------- ### Loading EasyMDE on Specific Textarea (jQuery) Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Initialize EasyMDE on a specific ``` -------------------------------- ### Building Production Code - npm Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/CONTRIBUTING.md Runs the build process to update the minified version of the code (angular-moment.min.js) and performs code linting with JSHint. ```Shell npm run build ``` -------------------------------- ### Running Unit Tests - npm Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/CONTRIBUTING.md Executes the project's unit tests using the configured test runner (Karma) and testing framework (Jasmine), and also performs code linting with JSHint. ```Shell npm test ``` -------------------------------- ### Use Autolinker Instance link Method - JavaScript Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Shows how to create an Autolinker instance and use its link method. This approach is more efficient when processing multiple strings with the same options. ```JavaScript var autolinker = new Autolinker( [ options ] ); var linkedText = autolinker.link( textToAutoLink ); ``` -------------------------------- ### Cloning angular-moment Repository - Git Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/CONTRIBUTING.md Clones the angular-moment source code repository from GitHub to your local machine. ```Shell git clone https://github.com/urish/angular-moment ``` -------------------------------- ### Loading SimpleMDE on Specific Textarea (JS) Source: https://github.com/polonel/trudesk/blob/master/src/public/js/vendor/easymde/README.md Initialize SimpleMDE on a specific ``` -------------------------------- ### Defining Root UI-View and Navigation Links (Nested Views) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/README.md This HTML snippet shows the main application layout (index.html) for nested views. It includes a root ui-view directive where parent state templates will be injected and ui-sref directives for navigation links to different states. ```HTML
State 1 State 2 ``` -------------------------------- ### Truncate and Disable New Window in Autolinker.js Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Shows how to combine the `truncate` option with `newWindow: false` when using Autolinker.link to limit the visible length of the link text while keeping the link opening in the same window. ```javascript var linkedText = Autolinker.link( "http://www.yahoo.com/some/long/path/to/a/file", { truncate: 25, newWindow: false } ); // Produces: "yahoo.com/some/long/pat.." ``` -------------------------------- ### Injecting and Using moment Constant in AngularJS (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Shows how to inject the moment constant into an AngularJS controller, service, or factory. This provides direct access to the Moment.js library instance for date manipulation and creation within your application logic. ```JavaScript angular.module('fooApp') .controller('FooCtrl', ['$scope', 'moment', function ($scope, moment) { $scope.exampleDate = moment().hour(8).minute(0).second(0).toDate(); }]); ``` -------------------------------- ### Applying angular-elastic Directive (Attribute) - HTML Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Shows the basic usage of the `msd-elastic` directive as an attribute on a ` ``` -------------------------------- ### Resetting Storage with Default Values (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngstorage/README.md Using the $reset() method with an object argument to clear the current storage and initialize it with the provided default values. ```javascript $localStorage.$reset({ counter: 42 }); ``` -------------------------------- ### Configuring Nested States with UI-Router Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/README.md This JavaScript code configures UI-Router states using $stateProvider and $urlRouterProvider. It defines parent states ('state1', 'state2') with URLs and templates, and nested child states ('state1.list', 'state2.list') with their own URLs, templates, and controllers. ```JavaScript myApp.config(function($stateProvider, $urlRouterProvider) { // // For any unmatched url, redirect to /state1 $urlRouterProvider.otherwise("/state1"); // // Now set up the states $stateProvider .state('state1', { url: "/state1", templateUrl: "partials/state1.html" }) .state('state1.list', { url: "/list", templateUrl: "partials/state1.list.html", controller: function($scope) { $scope.items = ["A", "List", "Of", "Items"]; } }) .state('state2', { url: "/state2", templateUrl: "partials/state2.html" }) .state('state2.list', { url: "/list", templateUrl: "partials/state2.list.html", controller: function($scope) { $scope.things = ["A", "Set", "Of", "Things"]; } }); }); ``` -------------------------------- ### Listening to elastic:resize Event - JavaScript Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Illustrates how to listen for the `elastic:resize` event emitted by the directive on the element's scope, providing access to the element and old/new heights for custom actions. Requires the `monospaced.elastic` module dependency. ```JavaScript $scope.$on('elastic:resize', function(event, element, oldHeight, newHeight) { // do stuff }); ``` -------------------------------- ### Including moment.js with Locale (HTML) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-moment/README.md Shows how to include a specific moment.js locale file (e.g., German 'de.js') after the main moment.js file but before angular-moment.js. This is the first step for enabling internationalization support. ```HTML ``` -------------------------------- ### Disabling Compression for Event Emission in Socket.IO (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/socket.io-client/README.md This snippet demonstrates how to use the `compress` method on a Socket.IO socket instance to disable compression for a subsequent event emission. By calling `socket.compress(false)` before `emit`, the data for 'an event' will not be compressed. This method returns the socket instance, allowing for chaining. ```js socket.compress(false).emit('an event', { some: 'data' }); ``` -------------------------------- ### Include ionic-modal-select Script in HTML Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ionic-modal-select/README.md Include the ionic-modal-select JavaScript file (or its minified version) in your index.html file to make the directive available in your application. ```HTML ``` -------------------------------- ### Customizing ngStorage Serialization (JavaScript) Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/ngstorage/README.md Shows how to provide custom functions for serializing and deserializing values stored by ngStorage using the `setSerializer` and `setDeserializer` methods on the `$localStorageProvider` during the Angular config phase. ```javascript angular.module('app', ['ngStorage']) .config(['$localStorageProvider', function ($localStorageProvider) { var mySerializer = function (value) { // Do what you want with the value. return value; }; var myDeserializer = function (value) { return value; }; $localStorageProvider.setSerializer(mySerializer); $localStorageProvider.setDeserializer(myDeserializer); }];) ``` -------------------------------- ### Configuring Autolinker.js Truncate Option (Object Form) - JavaScript Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/Autolinker.js/README.md Demonstrates how to configure the 'truncate' option for Autolinker.js using its object form. This allows specifying both the maximum 'length' of the truncated text and the 'location' ('end', 'middle', or 'smart') where the truncation should occur. ```javascript Autolinker.link( '...', { truncate: { length: 25, location: 'middle' } } ); ``` -------------------------------- ### Adding monospaced.elastic Module Dependency - JavaScript Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-elastic/README.md Shows how to add `monospaced.elastic` as a dependency to your main Angular application module to make the directive and config provider available. ```JavaScript angular .module('yourApp', [ 'monospaced.elastic' ]); ``` -------------------------------- ### Configuring States with Multiple Named Views Source: https://github.com/polonel/trudesk/blob/master/mobile/lib/angular-ui-router/README.md This JavaScript code configures UI-Router states to utilize multiple named views. Each state ('index', 'route1', 'route2') defines a views object where templates are assigned to specific named ui-view directives ('viewA', 'viewB') within the layout. ```JavaScript myApp.config(function($stateProvider) { $stateProvider .state('index', { url: "", views: { "viewA": { template: "index.viewA" }, "viewB": { template: "index.viewB" } } }) .state('route1', { url: "/route1", views: { "viewA": { template: "route1.viewA" }, "viewB": { template: "route1.viewB" } } }) .state('route2', { url: "/route2", views: { "viewA": { template: "route2.viewA" }, "viewB": { template: "route2.viewB" } } }) }); ```