{"id":13434101,"url":"https://github.com/textAngular/textAngular","last_synced_at":"2025-03-17T14:30:43.574Z","repository":{"id":53563010,"uuid":"13429048","full_name":"textAngular/textAngular","owner":"textAngular","description":"A radically powerful Text-Editor/Wysiwyg editor for Angular.js! Create multiple editor instances, two-way-bind HTML content, watch editors for changes and more!","archived":false,"fork":false,"pushed_at":"2023-09-20T14:09:53.000Z","size":3987,"stargazers_count":3967,"open_issues_count":543,"forks_count":1146,"subscribers_count":119,"default_branch":"master","last_synced_at":"2024-10-29T15:35:09.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textAngular.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-10-09T00:26:02.000Z","updated_at":"2024-10-14T19:20:18.000Z","dependencies_parsed_at":"2024-04-16T23:41:56.097Z","dependency_job_id":"2549c631-dab4-41f8-9035-d67a43b046f5","html_url":"https://github.com/textAngular/textAngular","commit_stats":{"total_commits":784,"total_committers":88,"mean_commits":8.909090909090908,"dds":0.5982142857142857,"last_synced_commit":"ff8e48087f780d30f54e77b06f09e0b85f9517e9"},"previous_names":["fraywing/textangular"],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textAngular%2FtextAngular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textAngular%2FtextAngular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textAngular%2FtextAngular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textAngular%2FtextAngular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textAngular","download_url":"https://codeload.github.com/textAngular/textAngular/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893848,"owners_count":20364918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:45.869Z","updated_at":"2025-03-17T14:30:43.173Z","avatar_url":"https://github.com/textAngular.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","基于 Angular","For Angular"],"sub_categories":[],"readme":"textAngular v1.5.16\n===========\n\n[![Build Status](https://travis-ci.org/fraywing/textAngular.png?branch=master)](https://travis-ci.org/fraywing/textAngular) [![Coverage Status](https://coveralls.io/repos/fraywing/textAngular/badge.png)](https://coveralls.io/r/fraywing/textAngular)\n\n\nDemo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http://plnkr.co/edit/hz3x2f?p=preview))\n\n#### Upgrading From 1.2.2 or earlier\n\nTo upgrade from version 1.2.2 or earlier you need to follow these steps:\n\n1. The styling for textAngular is now in the `dist/textAngular.css` file, you will need to include this or a copy of it with your own modifications.\n2. The rangy library is now required, you will need both the `rangy-core` and `rangy-selectionsaverestore` modules, alternatively you can include the compressed version (`textAngular-rangy.min.js`) in the dist folder\n\n## Requirements\n\n1. `AngularJS` ≥ `1.3.x`\n2. `Rangy` ≥ `1.3.x`, Both rangy-core and rangy-selectionsaverestore are required. (There is a minified combination of these two included in the dist folder)\n3. `Font-Awesome` ≥ `4.x` for the default icons on the toolbar\n1. `Bootstrap` ≥ `3.x` for the default styles (Can use `bootstrap-css-only`, you must add this to your bower or include this manually)\n5. NOTE: please check the requirements for earlier releases, if these are an issue.\n\n### Where to get it\n\n**NOTE:** Our `textAngular-sanitize.js` and angular.js's `angular-sanitize.js` are the SAME file, you must include one or the other but not both. We highly recommend using `textAngular-sanitize.js` as it loosens some parts of the sanitizer that are far too strict for our uses and adds some more features we need.\n\n**Via Bower:**\n\nRun `bower install textAngular` from the command line.\nInclude script tags similar to the following:\n```html\n\u003clink rel='stylesheet' href='/bower_components/textAngular/dist/textAngular.css'\u003e\n\u003cscript src='/bower_components/textAngular/dist/textAngular-rangy.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/bower_components/textAngular/dist/textAngular-sanitize.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/bower_components/textAngular/dist/textAngular.min.js'\u003e\u003c/script\u003e\n```\n\n**Via NPM:**\n\nRun `npm install textangular` from the command line.\nInclude script tags similar to the following:\n```html\n\u003clink rel='stylesheet' href='/node_modules/textangular/dist/textAngular.css'\u003e\n\u003cscript src='/node_modules/textangular/dist/textAngular-rangy.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/node_modules/textangular/dist/textAngular-sanitize.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/node_modules/textangular/dist/textAngular.min.js'\u003e\u003c/script\u003e\n```\nInstall using commonjs (eg componentjs, Webpack, Browserify):\n```\nangular.module('myModule', [require('angular-sanitize'), require('textAngular')]);\n```\nOptionally, install textAngular-sanitize.min.js by requiring it BEFORE requring textAngular:\n```\nrequire('textangular/dist/textAngular-sanitize.min');\nangular.module('myModule', [require('textAngular')]);\n```\nFor CSS support with Webpack, install the style-loader, css-loader (and postcss-loader) and configure the loader in your webpack.config.js similar to the following:\n```\nloaders: [\n  {test: /\\.css$/, loader: 'style!css!postcss'}\n]\n```\n\n**Via CDNJS:**\n\nInclude script tags similar to the following:\n```html\n\u003cscript src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.5.0/textAngular-rangy.min.js'\u003e\u003c/script\u003e\n\u003cscript src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.5.0/textAngular-sanitize.min.js'\u003e\u003c/script\u003e\n\u003cscript src='http://cdnjs.cloudflare.com/ajax/libs/textAngular/1.5.0/textAngular.min.js'\u003e\u003c/script\u003e\n```\n\n**Via jsDelivr:**\n\nInclude script tag similar to the following: (For details on how this works see: [https://github.com/jsdelivr/jsdelivr#load-multiple-files-with-single-http-request](https://github.com/jsdelivr/jsdelivr#load-multiple-files-with-single-http-request))\n```html\n\u003cscript src='http://cdn.jsdelivr.net/g/angular.textangular@1.5.0(textAngular-rangy.min.js+textAngular-sanitize.min.js+textAngular.min.js)'\u003e\u003c/script\u003e\n```\n\n**Via Github**\n\nDownload the code from [https://github.com/fraywing/textAngular/releases/latest](https://github.com/fraywing/textAngular/releases/latest), unzip the files then add script tags similar to the following:\n```html\n\u003clink rel='stylesheet' href='/path/to/unzipped/files/dist/textAngular.min.css'\u003e\n\u003cscript src='/path/to/unzipped/files/dist/textAngular-rangy.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/path/to/unzipped/files/dist/textAngular-sanitize.min.js'\u003e\u003c/script\u003e\n\u003cscript src='/path/to/unzipped/files/dist/textAngular.min.js'\u003e\u003c/script\u003e\n```\n\n### Usage\n\n1. Include (`rangy-core.js` and `rangy-selectionsaverestore.js`) or `textAngular-rangy.min.js` in your project using script tags\n2. Include `textAngular-sanitize.js` or `textAngular-sanitize.min.js` in your project using script tags\n3. Include (`textAngularSetup.js` and `textAngular.js`) or `textAngular.min.js` (textAngularSetup.js is included inside textAngular.min.js)\n4. Add a dependency to `textAngular` in your app module, for example: ```angular.module('myModule', ['textAngular'])```.\n5. Create an element to hold the editor and add an `ng-model=\"htmlVariable\"` attribute where `htmlVariable` is the scope variable that will hold the HTML entered into the editor:\n```html\n\u003cdiv text-angular ng-model=\"htmlVariable\"\u003e\u003c/div\u003e\n```\nOR\n```html\n\u003ctext-angular ng-model=\"htmlVariable\"\u003e\u003c/text-angular\u003e\n```\nThis acts similar to a regular AngularJS / form input if you give it a name attribute, allowing for form submission and AngularJS form validation.\n\nHave fun!\n\n**Important Note:** Though textAngular supports the use of all attributes in it's input, please note that angulars ng-bind-html **WILL** strip out all of your style attributes if you are using `angular-sanitize.js`.\n\nFor Additional options see the [github Wiki](https://github.com/fraywing/textAngular/wiki).\n\n### Issues?\n\ntextAngular uses ```execCommand``` for the rich-text functionality.\nThat being said, its still a fairly experimental browser feature-set, and may not behave the same in all browsers - see http://tifftiff.de/contenteditable/compliance_test.html for a full compliance list.\nIt has been tested to work on Chrome, Safari, Opera, Firefox and Internet Explorer 8+.\nIf you find something, please let me know - throw me a message, or submit an issue request!\n\n### FAQ\n\n1. **Toolbar shows up with some being blank instead of icons**\u003cbr/\u003e\nYou need to include font-awesome on your page or nothing will show up.\n1. **Youtube Insert embeds a ```\u003cimg\u003e``` tag and aren't showing the video.**\u003cbr/\u003e\nThe problems with iFrames are that they are a security risk so the sanitizer by default strips them out. Instead of changing the sanitizer to allow iFrames we use a placeholder for youtube videos which has the added advantage of allowing you to edit their size and placement in the editor. To display the youtube videos when you aren't in the editor use the following html: ```\u003cdiv ta-bind ng-model=\"data.htmlcontent\"\u003e\u003c/div\u003e```. This invokes our custom renderers to convert the ```\u003cimg\u003e``` tags back into the youtube video you expect.\n2. **But I want to use Youtube outside of angular**\u003cbr/\u003e\nYou'll have to apply the renderers manually, see comment in issue [#469](https://github.com/fraywing/textAngular/issues/469#issuecomment-68650506) for details.\n3. **IE Is automatically converting typed links to `\u003ca href...\u003e` tags**\u003cbr/\u003e\nThis is a known issue with IE, to prevent this run the following javascript after page load: `document.execCommand(\"AutoUrlDetect\", false, false)`. See [#475](https://github.com/fraywing/textAngular/issues/475) for details.\n4. **Error `\"textAngular Error: An editor with the name already exists\"` occurs**\u003cbr/\u003e\nSee Issue [#240](https://github.com/fraywing/textAngular/issues/240) for specific details on why this occurs and how to resolve it.\n\n## Developer Notes\n\nWhen checking out, you need a node.js installation, running `npm install` and then `bower install` will get you setup with everything to run the unit tests and minification.\nAll changes should be done in the src folder, running `grunt compile` to compile the app or use `grunt watch` to compile the files as you save them.\nWhen you are ready to create A PR check that `grunt` passes without errors and you have created tests for your feature if necessary.\n\n## Customization\n\nIt is possible to override the toolbar by using a decorator in the module's .config block. Simply set the taOptions.toolbar to an array of arrays comprised of button names. Each array of button names represents a button group. The default toolbar can be represented like so:\n```html\n  taOptions.toolbar = [\n      ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'quote'],\n      ['bold', 'italics', 'underline', 'strikeThrough', 'ul', 'ol', 'redo', 'undo', 'clear'],\n      ['justifyLeft', 'justifyCenter', 'justifyRight', 'indent', 'outdent'],\n      ['html', 'insertImage','insertLink', 'insertVideo', 'wordcount', 'charcount']\n  ];\n```\nNew buttons can be created using taRegisterTool. Examples can be found inside demo/static-demo.html\n\n## License\n\nThis project is licensed under the [MIT license](http://opensource.org/licenses/MIT).\n\n\n## Contributers\n\nSpecial thanks to all the contributions thus far!\n\nFor a full list see: https://github.com/fraywing/textAngular/graphs/contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FtextAngular%2FtextAngular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FtextAngular%2FtextAngular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FtextAngular%2FtextAngular/lists"}