misc.html 14.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
<section>
	<h1 class="blue" data-id="#plugins/misc"><i class="ace-icon fa fa-magic grey"></i> Miscellaneous</h1>

	<div class="hr hr-double hr32"></div>
	<div class="space-4"></div>

	<div class="help-content">

		<h3 class="info-title smaller" data-id="#plugins/misc.inline-editable">Inline Editable</h3>
		<!-- #section:plugins/misc.inline-editable -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more information inline editable plugin and its option, please see its page at:
				<a href="http://vitalets.github.io/x-editable/">vitalets.github.io/x-editable/</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/css/bootstrap-editable.css</code>
				<code>assets/js/x-editable/bootstrap-editable.js</code>
			</li>

			<li>
				There are also five additional addons for the plugin that you can use
				by including:
				<br />
				<code>assets/js/x-editable/ace-editable.js</code>
				<br />
				For more info see <a href="#custom/inline-editable" class="help-more">Inline Editable Addons</a>
			</li>
			
			<li>
				When using some editables you should include their relevant CSS and JS files first.
				<Br />
				For example when using Select2 or Datepicker editables
			</li>
			
			<li>
				For an example of some of the editables, you can see profile page:
				<br />
				<code data-open-file="javascript" class="open-file"><span class="brief-show">mustache/app/views/assets/scripts/</span>profile.js</code>
			</li>
		 </ul>
		</div>
		<!-- /section:plugins/misc.inline-editable -->
	</div>
	
	
	
	<div class="space-12"></div>
	

	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.jquery-validate">jQuery Validate</h3>
		<!-- #section:plugins/misc.jquery-validate -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more information and examples please see:
				<br />
				<a href="http://jqueryvalidation.org/">jqueryvalidation.org</a>
			</li>
			
			<li>
				To use jQuery Validate you should include:
				<br />
				<code>assets/js/jquery.validate.js</code>
				<br />
				There are also additional validation methods for which you should include:
				<br />
				<code>assets/js/additional-methods.js</code>
			</li>
			
			<li>
				A basic example could be like this:
<pre data-language="javascript">
$('#my-form').validate({
    errorElement: 'div',
    errorClass: 'help-block',
    focusInvalid: false,
    rules: {
       email: {
          required: true,
          email: true
       },
       name: {
          required: true
       },
       url: {
          required: true,
          url: true
       }
    },

    messages: {
        email: {
           required: "Please provide a valid email.",
           email: "Please provide a valid email."
        }
    },

    highlight: function (e) {
        $(e).closest('.form-group').removeClass('has-info').addClass('has-error');
    },

    success: function (e) {
        $(e).closest('.form-group').removeClass('has-error').addClass('has-info');
        $(e).remove();
    },

    errorPlacement: function (error, element) {
        error.insertAfter(element.parent());
    }
});
</pre>
			Error placement and highlighting is arbitrary and depends on your HTML structure.

			</li>
			
			<li>
				Note that by default when an element is hidden, it will not be validated.
				<br />
				You should use <code>ignore</code> option for more control:
<pre data-language="javascript">
$('#my-form').validate({
   //...
   ignore: ":hidden:not(select.chosen-select)"
   //...
});
</pre>
				In this example, because Chosen plugin hides original <code>select</code> element,
				we can use this to make sure validation is performed.
			</li>
			
			<li>
				Please see form wizard page for a more detailed example
			</li>
			
		 </ul>
		</div>
		<!-- /section:plugins/misc.jquery-validate -->

	</div>
	
	

	
	<div class="space-12"></div>
	
	
	
	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.colorbox">jQuery Colorbox</h3>
		<!-- #section:plugins/misc.colorbox -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more information about the plugin please see its page at:
				<br />
				<a href="http://www.jacklmoore.com/colorbox/">www.jacklmoore.com/colorbox/</a>
			</li>
			
			<li>
				Colorbox plugin is used for slideshow as shown in gallery page.
				<br />				
				To use it, you should include:
				<br />
				<code>assets/css/colorbox.css</code>
				<br />
				<code>assets/js/jquery.colorbox-min.js</code>
			</li>
		
			<li>
				A basic example would be like this:
<pre data-language="html">
<a href="path/to/image1" data-rel="colorbox">
  <img alt="image1" src="path/to/thumb1" /> 
</a>
<a href="path/to/image2" data-rel="colorbox">
  <img alt="image2" src="path/to/thumb2" /> 
</a>
</pre>
<pre data-language="javascript">
var colorbox_params = {
          rel: 'colorbox',
   reposition: true,
  scalePhotos: true,
    scrolling: false,
     previous: '&lt;i class="ace-icon fa fa-arrow-left"&gt;&lt;/i&gt;',
         next: '&lt;i class="ace-icon fa fa-arrow-right"&gt;&lt;/i&gt;',
        close: '&amp;times;',
      current: '{current} of {total}',
     maxWidth: '100%',
    maxHeight: '100%',
   onComplete: function(){
     $.colorbox.resize();
   }
}
 
$('[data-rel="colorbox"]').colorbox(colorbox_params);
$('#cboxLoadingGraphic').append("&lt;i class='ace-icon fa fa-spinner orange'&gt;&lt;/i&gt;");
</pre>
			</li>
		 </ul>
		</div>
		<!-- /section:plugins/misc.colorbox -->
	</div>


	<div class="space-12"></div>


	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.dropzone">Dropzone.js</h3>
		<!-- #section:plugins/misc.dropzone -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				If you want advanced file upload, you should consider using Dropzone.js plugin.
				<br />
				Fore more info and examples about it please see:
				<a href="http://www.dropzonejs.com/">www.dropzonejs.com</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/css/dropzone.css</code>
				<br />
				<code>assets/js/dropzone.js</code>
			</li>
			
			<li>
				Any elment with <code>.dropzone</code> class will be automaically converted to a file upload area,
				unless you set <code>Dropzone.autoDiscover = false</code>
			</li>
			
			<li>
				For a basic example please see:
				<br />
				<code data-open-file="javascript" class="open-file"><span class="brief-show">mustache/app/views/assets/scripts/</span>dropzone.js</code>
			</li>

		 </ul>
		</div>
		<!-- /section:plugins/misc.dropzone -->
	</div>
	
	

	<div class="space-12"></div>


	<div class="help-content">

		<h3 class="info-title smaller" data-id="#plugins/misc.bootbox">Bootbox</h3>
		<!-- #section:plugins/misc.bootbox -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				Bootbox is a wrapper plugin for Bootstrap modals which allows easy
				creation of dialogs.
				<br />
				For more info and examples about it please see:
				<a href="http://bootboxjs.com/">bootboxjs.com</a>
			</li>
		
			<li>
				To use it, you should include:
				<br />
				<code>assets/js/bootbox.js</code>
			</li>
			
			<li>
				A basic example would be like this:
<pre data-language="javascript">
$('#some-button').on('click', function() {
  bootbox.confirm('Are you sure?', function(result) {
    if(result) {
       //do something
    }
  })
})
</pre>

<pre data-language="javascript">
$("#some-button").on('click', function() {
  bootbox.confirm({
    message: "Are you sure?",
    buttons: {
       confirm: {
          label: "OK",
          className: "btn-primary btn-sm",
       },
       cancel: {
          label: "Cancel",
          className: "btn-sm",
       }
    },
    callback: function(result) {
       //if(result) do something;
    }
 });
});
</pre>

<pre data-language="javascript">
$("#some-button").on('click', function() {
   bootbox.dialog({
      message: "I am a custom dialog with custom buttons,
      buttons:
      {
         "success" :
         {
            "label" : "&lt;i class='ace-icon fa fa-check'&gt;&lt;/i&gt; Success!",
            "className" : "btn-sm btn-success",
            "callback": function() {
                 //clicked, do something
            }
         },
         "danger" :
         {
             "label" : "Danger!",
             "className" : "btn-sm btn-danger",
             "callback": function() {
                 //clicked, do something
             }
         }
      }
   })
})
</pre>

			</li>
			
		 </ul>
		</div>
		<!-- /section:plugins/misc.bootbox -->
	</div>
	

	
	<div class="space-12"></div>
		
	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.colorpicker">Colorpicker</h3>
		<!-- #section:plugins/misc.colorpicker -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more info about colorpicker plugin, please see:
				<a href="http://www.eyecon.ro/bootstrap-colorpicker">http://www.eyecon.ro/bootstrap-colorpicker</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/css/colorpicker.css</code>
				<br />
				<code>assets/js/bootstrap-colorpicker.js</code>
			</li>
			
			<li>
				A basic example would be like this:
<pre data-language="html">
 <input type="text" name="color" id="colorpicker1" />
</pre>
<pre data-language="javascript">
$('#colorpicker1').colorpicker();
</pre>
			</li>
			
			<li>
				You can also use browser's built-in color picker which could be a better option on small touch devices:
<pre data-language="html">
 <input type="color" name="color" id="colorpicker1" />
</pre>
<pre data-language="javascript">
var picker = $('#colorpicker1')[0];
if(picker.type !== 'color') {//if browser doesn't have built-in colorpicker
  $(picker).colorpicker();
}
</pre>
			</li>
			
			<li>
				You can also use <a href="#custom/colorpicker" class="help-more">custom color picker</a>
			</li>
		 </ul>
		</div>
		<!-- /section:plugins/misc.colorpicker -->
	</div>
	
	
	
	<div class="space-12"></div>


	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.gritter">Gritter</h3>
		<!-- #section:plugins/misc.gritter -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				Gritter is a growl-like notifications plugin for jQuery.
				<br />
				Fore more info and examples please see:
				<a href="https://github.com/jboesch/Gritter">https://github.com/jboesch/Gritter</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/css/jquery.gritter.css</code>
				<br />
				<code>assets/css/jquery.gritter.js</code>
			</li>

			
			<li>
				A few additional styles are also available which as follows:
				<ol>
					<li><code>.gritter-info</code></li>
					<li><code>.gritter-error</code></li>
					<li><code>.gritter-success</code></li>
					<li><code>.gritter-warning</code></li>
					<li class="space-6"></li>
					<li><code>.gritter-light</code> light color style</li>
					<li class="space-6"></li>
					<li><code>.gritter-center</code> centers the notification box</li>
				</ol>
<pre data-language="html">
jQuery.gritter.add({
    title: 'This is a sticky notice!',
    text: 'Sticky content',
    image: 'path/to/image',
    sticky: true,
    time: '',
    class_name: 'gritter-info gritter-light gritter-center'
});

</pre>
			</li>
			
		 </ul>
		</div>
		<!-- /section:plugins/misc.gritter -->
	</div>

	
	<div class="space-12"></div>

	
	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.nestable-list">Nestable Lists</h3>
		<!-- #section:plugins/misc.nestable-list -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more information and examples please see 
			</li>
			
			<li>
				To use nestable lists you should include:
				<br />
				<code>assets/js/jquery.nestable.js</code>
			</li>

			<li>
				You can use different color classes for list items.
				<br />
				See <a href="#pages/dashboard.tasks" class="help-more">Dashboard Tasks</a> for more info
			</li>
			
			<li>
				A basic example is like this:
<pre data-language="html">
<div class="dd">
<ol class="dd-list">
  <li class="dd-item item-red" data-id="7"><div class="dd-handle">Item 7</div></li>
</ol>
</div>
</pre>

<pre data-language="html">
<div class="dd dd-draghandle">
<ol class="dd-list">
  <li class="dd-item dd2-item dd-colored" data-id="17">
     <div class="dd-handle dd2-handle btn-info">
        <i class="normal-icon ace-icon fa fa-pencil-square-o"></i>
        <i class="drag-icon ace-icon fa fa-arrows"></i>
     </div>
     <div class="dd2-content btn-info no-hover">Published Articles</div>
  </li>
</ol>
</div>
</pre>

In the above example, when dragging starts <code>.normal-icon</code> will be hidden and
<code>.drag-icon</code> is shown

<pre data-language="javascript">
$('.dd').nestable();
$('.dd-handle a').on('mousedown', function(e){
   e.stopPropagation();
});
</pre>
			</li>
			
		 </ul>
		</div>
		<!-- /section:plugins/misc.nestable-list -->
	</div>

	
	
	<div class="space-12"></div>


	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.slimscroll">slimScroll</h3>
		<!-- #section:plugins/misc.slimscroll -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				slimScroll is a lightweight scroll plugin using jQuery UI.
				<br />
				I've included in case you are already using it,
				but you can use the <a href="#custom/scrollbar" class="help-more">custom scroll plugin</a>
			</li>
			
			<li>
				For more info about it, please see:
				<a href="https://github.com/rochal/jQuery-slimScroll">https://github.com/rochal/jQuery-slimScroll</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/js/jquery-ui.custom.js</code>
				<br />
				<code>assets/js/jquery.slimscroll.js</code>
			</li>
		 </ul>
		</div>
		<!-- /section:plugins/misc.slimscroll -->
	</div>
	
	
	<div class="space-12"></div>


	<div class="help-content">
		<h3 class="info-title smaller" data-id="#plugins/misc.raty">Star Rating</h3>
		<!-- #section:plugins/misc.raty -->
		<div class="info-section">
		 <ul class="info-list list-unstyled">
			<li>
				For more info and examples about Raty star rating plugin, please see:
				<a href="http://wbotelhos.com/raty/">http://wbotelhos.com/raty/</a>
			</li>
			
			<li>
				To use it, you should include:
				<br />
				<code>assets/js/jquery.raty.js</code>
			</li>
		 </ul>
		</div>
		<!-- /section:plugins/misc.raty -->
	</div>
	

</section>