mentio.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <div ng-view></div>
  2. <ul class="list-group user-search">
  3. <li mentio-menu-item="person" ng-repeat="person in items" class="list-group-item">
  4. <img ng-src="{{person.imageUrl}}" class="user-photo">
  5. <span class="text-primary" ng-bind-html="person.name | mentioHighlight:typedTerm:'menu-highlighted' | unsafe"></span>
  6. <em class="text-muted" ng-bind="person.bio | words:5"></em>
  7. </li>
  8. </ul>
  9. <ul class="list-group product-search demo-scrollable-menu">
  10. <li mentio-menu-item="product" ng-repeat="product in items" class="list-group-item clearfix">
  11. <div class="row">
  12. <div class="col-xs-2 text-center">
  13. <img ng-src="{{product.imageUrl}}" class="product-photo">
  14. </div>
  15. <div class="col-xs-10">
  16. <h4 class="list-group-item-heading">{{product.title | words:5}}</h4>
  17. <p class="list-group-item-text">{{product.description | words:7}}</p>
  18. </div>
  19. </div>
  20. </li>
  21. </ul>
  22. <form action="#">
  23. <div class="container">
  24. <div class="row">
  25. <header class="text-center">
  26. <h1 class="heading">Ment.io</h1>
  27. <h6 class="text-muted">(Angular @mentions with macros)</h6>
  28. </header>
  29. </div>
  30. <div class="row">
  31. <div class="col-md-12">
  32. <div class="form-group">
  33. <h3>Content Editable:</h3>
  34. <div contenteditable mentio
  35. mentio-typed-term="typedTerm"
  36. mentio-macros="macros"
  37. mentio-require-leading-space="true"
  38. mentio-select-not-found="true"
  39. class="editor form-control"
  40. mentio-id="'htmlContent'"
  41. id="htmlContent"
  42. ng-model="htmlContent"
  43. >
  44. </div>
  45. <span class="caption small">Mentioned: {{typedTerm}}</span>
  46. </div>
  47. <mentio-menu
  48. mentio-for="'htmlContent'"
  49. mentio-trigger-char="'@'"
  50. mentio-items="people"
  51. mentio-template-url="/people-mentions.tpl"
  52. mentio-search="searchPeople(term)"
  53. mentio-select="getPeopleText(item)"
  54. ></mentio-menu>
  55. <div class="form-group">
  56. <h3>Text Area:</h3>
  57. <textarea mentio
  58. mentio-macros="macros"
  59. mentio-trigger-char="'@'"
  60. mentio-items="people"
  61. mentio-template-url="/people-mentions.tpl"
  62. mentio-search="searchPeople(term)"
  63. mentio-select="getPeopleTextRaw(item)"
  64. mentio-typed-term="typedTerm2"
  65. class="editor form-control"
  66. mentio-id="'theTextArea'"
  67. ng-model="theTextArea"
  68. ng-trim="false"
  69. rows="6">
  70. </textarea>
  71. <span class="caption small">Mentioned: {{typedTerm2}}</span>
  72. </div>
  73. <mentio-menu
  74. mentio-for="'theTextArea'"
  75. mentio-trigger-char="'#'"
  76. mentio-items="products"
  77. mentio-template-url="/product-mentions.tpl"
  78. mentio-search="searchProducts(term)"
  79. mentio-select="getProductTextRaw(item)"></mentio-menu>
  80. <div class="form-group">
  81. <h3>Text Input:</h3>
  82. <!--Note the use of an angular expression for the ID. This can be done within ng-repeat using $index-->
  83. <input mentio
  84. ng-model="theText"
  85. mentio-id="'theText' + myIndexValue"
  86. type="text"
  87. class="form-control"
  88. ng-trim="false"
  89. size="100"/>
  90. </div>
  91. <mentio-menu
  92. mentio-for="'theText' + myIndexValue"
  93. mentio-trigger-char="'#'"
  94. mentio-items="products"
  95. mentio-template-url="/product-mentions.tpl"
  96. mentio-search="searchProducts(term)"
  97. mentio-select="getProductTextRaw(item)"></mentio-menu>
  98. <mentio-menu
  99. mentio-for="'theText' + myIndexValue"
  100. mentio-trigger-char="'@'"
  101. mentio-items="people"
  102. mentio-template-url="/people-mentions.tpl"
  103. mentio-search="searchPeople(term)"
  104. mentio-select="getPeopleTextRaw(item)"></mentio-menu>
  105. <div class="form-group">
  106. <h3>Minimal:</h3>
  107. <!--Note no need for external mentio-menu elements because there is only one trigger character needed-->
  108. <input type="text" mentio mentio-typed-text="typedTerm" mentio-items="simplePeople | filter:label:typedTerm" class="form-control" ng-model="theTextArea2"
  109. size="100"/>
  110. </textarea>
  111. </div>
  112. <div class="form-group">
  113. <h3>TinyMCE (iframe-based):</h3>
  114. <textarea ui-tinymce="tinyMceOptions" mentio mentio-typed-text="typedTerm"
  115. mentio-items="simplePeople | filter:label:typedTerm" ng-model='foo'
  116. mentio-iframe-element="iframeElement"></textarea>
  117. </div>
  118. <div class="form-group">
  119. <input type="submit">
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </form>
  125. </div>