Changeset 1149615
- Timestamp:
- 04/29/2015 11:05:50 PM (11 years ago)
- Location:
- angularjs-for-wp/trunk
- Files:
-
- 1 added
- 7 edited
-
angularjs-templates/list-detail.html (modified) (1 diff)
-
angularjs-templates/post-content.html (modified) (1 diff)
-
angularjs-templates/single-detail.html (modified) (1 diff)
-
includes/contentFilter.php (modified) (1 diff)
-
js/angular-app.js (modified) (1 diff)
-
js/html-janitor.js (added)
-
plugin.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
angularjs-for-wp/trunk/angularjs-templates/list-detail.html
r931561 r1149615 36 36 <article> 37 37 <h2>{{post.title}}</h2> 38 <div ng-bind-html="post.content | unsafe"></div>38 <div ng-bind-html="post.content | sanitize"></div> 39 39 <a href="{{post.link}}">Read More...</a> 40 40 <hr /> -
angularjs-for-wp/trunk/angularjs-templates/post-content.html
r1132529 r1149615 2 2 unlike other templates, you must use post.content_raw for this template. 3 3 --> 4 5 <div ng-bind-html= "content | unsafe"></div>4 <pre>{{content | json }}</pre> 5 <div ng-bind-html='content | sanitize'></div> -
angularjs-for-wp/trunk/angularjs-templates/single-detail.html
r931561 r1149615 36 36 <article> 37 37 <h2>{{post.title}}</h2> 38 <div ng-bind-html="post.content | unsafe"></div>38 <div ng-bind-html="post.content | sanitize"></div> 39 39 <a href="{{post.link}}">Read More...</a> 40 40 <hr /> -
angularjs-for-wp/trunk/includes/contentFilter.php
r1132529 r1149615 6 6 $meta = get_post_meta($post->ID, 'angularjsLoad', true); 7 7 $meta = intval($meta); 8 8 $content = str_replace('"', '\'', $content ); 9 9 10 if($meta){ 10 11 $content = '<div ng-app="wpAngularPlugin"><ng-post-content id="'.$post->ID.'" content="'.$content.'"></ng-post-content></div>'; -
angularjs-for-wp/trunk/js/angular-app.js
r1132529 r1149615 1 1 var angular_app = angular.module('wpAngularPlugin', ['ngSanitize']); 2 2 3 angular_app.filter('unsafe', function($sce) { 4 return function(val) { 5 if( $sce.trustAsHtml(val) ) 6 return $sce.trustAsHtml(val).toString(); 3 angular_app.filter('unsafe', function ($sce) { 4 return function (val) { 5 return $sce.trustAsHtml(val); 6 }; 7 }); 8 9 var janitor = new HTMLJanitor({ 10 tags: { 11 div: { 12 id: true, 13 class: true 14 }, 15 p: { 16 id: true, 17 class: true 18 }, 19 code: {}, 20 pre: {}, 21 // TODO: Map b => strong 22 strong: {}, 23 b: {}, 24 // TODO: Map em => i 25 em: {}, 26 i: {}, 27 // TODO: Map strike => del 28 strike: {}, 29 del: {}, 30 a: { href: true }, 31 ul: {}, 32 ol: {}, 33 li: {}, 34 blockquote: {}, 35 h1: {}, 36 h2: {}, 37 h3: {}, 38 h4: {}, 39 h5: {}, 40 h6: {}, 41 sub: {}, 42 sup: {} 43 } 44 }); 45 46 angular_app.filter('sanitize', function (unsafeFilter) { 47 return function (val) { 48 return unsafeFilter(janitor.clean(val)); 7 49 }; 8 50 }); -
angularjs-for-wp/trunk/plugin.php
r1149594 r1149615 4 4 * Plugin URI: http://www.roysivan.com/angularjs-for-wordpress 5 5 * Description: This plugin will allow you to easily load WordPress content client-side using AngularJS. JSON REST API required. 6 * Version: 1.2. 16 * Version: 1.2.2 7 7 * Author: Roy Sivan 8 8 * Author URI: http://www.roysivan.com … … 14 14 require_once('includes/shortcodes.php'); 15 15 16 define('WordPressAngularJS', '1.2 ');16 define('WordPressAngularJS', '1.2.2'); 17 17 18 18 class WordPressAngularJS { … … 27 27 wp_enqueue_script('angular-core', plugin_dir_url( __FILE__ ).'js/angular.min.js', array('jquery'), null, false); 28 28 wp_enqueue_script('angular-sanitize', plugin_dir_url( __FILE__ ).'js/angular-sanitize.min.js', array('jquery'), null, false); 29 wp_enqueue_script('angular-app', plugin_dir_url( __FILE__ ).'js/angular-app.js', array('jquery'), null, false); 29 wp_enqueue_script('html-janitor', plugin_dir_url( __FILE__ ).'js/html-janitor.js', array('jquery'), null, false); 30 31 wp_enqueue_script('angular-app', plugin_dir_url( __FILE__ ).'js/angular-app.js', array('html-janitor'), null, false); 30 32 31 33 // Angular Factories -
angularjs-for-wp/trunk/readme.txt
r1149594 r1149615 5 5 Requires at least: 3.9 6 6 Tested up to: 4.2.1 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 = 1.2.1 = 71 71 * Child Theme Support 72 73 = 1.2.2 = 74 * Adding in HTML Janitor - [fixing issue](https://github.com/royboy789/angularjs-for-wordpress/issues/6)
Note: See TracChangeset
for help on using the changeset viewer.