Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // os__text.bh.js
  2. module.exports = function(bh) {
  3.     bh.match('os__text', function(ctx) {
  4.         ctx.tag('p'),
  5.         ctx.content([
  6.             {
  7.               content: 'Доступно для iPhone, iPad, Android, Windows phone, Mac OS, Windows 8'
  8.             }
  9.         ]);
  10.     });
  11. };
  12.  
  13. // intro.bh.js
  14. module.exports = function(bh) {
  15.     bh.match('intro', function(ctx) {
  16.         ctx.tag('section');
  17.         ctx.content([
  18.           {
  19.             block: 'container',
  20.             content: [
  21.               {
  22.                 block: 'title',
  23.                 mods: { theme: 'white'}
  24.               },
  25.               {
  26.                 block: 'link',
  27.                 cls: 'btn-download',
  28.                 url: '#',
  29.                 content: 'Скачать приложение'
  30.               },
  31.               {
  32.                 block: 'os',
  33.                 content: [
  34.                   {
  35.                     elem: 'link',
  36.                     mods: { os: 'ios' }
  37.                   },
  38.                   {
  39.                     elem: 'link',
  40.                     mods: { os: 'ms' }
  41.                   },
  42.                   {
  43.                     block: 'os',
  44.                     elem: 'text'
  45.                   }
  46.                 ]
  47.               }
  48.             ]
  49.           }
  50.           ])
  51.     });
  52.     bh.match('os__link', function(ctx) {
  53.       ctx.tag('a');
  54.     });
  55.    
  56. };
  57.  
  58. // Трансформируется в
  59.  
  60. <div class="os">
  61.     <a class="os__link os__link_os_ios"></a>
  62.     <a class="os__link os__link_os_ms"></a>
  63.     <p class="os__text"></p>
  64.     <div>Доступно для iPhone, iPad, Android, Windows phone, Mac OS, Windows 8</div>
  65.     <p></p>
  66. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement