12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
-
-
- <div id="photo_upload">
- <label for="description">Photo</label>
- <br /><input type="file" name="photo" id="photo" accept="image/gif,image/jpeg,image/jpg,image/png"/>
- <div style="font-size:11px; color:#666; margin-top:5px;">
- Supports JPEG, GIF and PNG. <strong>Max size is 10 MB.</strong>
- </div>
- <div style="font-size:11px; color:#666; margin-top:5px;">
- <a href="#" class="linkFrm">Use a URL instead</a>
- </div>
- </div>
-
- <div id="photo_url">
- <label for="description">Photo URL</label>
- <br /><input class="input-text" type="text" name="url" id="url" value="{editUrl}" style="width:400px"/>
- <div style="font-size:11px; color:#666; margin-top:5px;">
- <a href="#" class="linkFrm">Use a upload form instead</a>
- </div>
- </div>
-
- <div>
- <label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
- <textarea rows="12" cols="84" name="description" id="description">{editBody}</textarea>
- </div>
-
- <input type="hidden" name="title" id="title" value="" />
- <input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
- <input type="hidden" name="type" id="type" value="{type}" />
- <input type="hidden" name="date" id="date" value="{date}" />
- <input type="hidden" name="id_user" id="id_user" value="{id_user}" />
-
-
-
-
- <script>
- $('#photo_url').css('display','none');
- $("#autosave").validate({
- rules: {
- photo: {
- required: function() {
- return ($('#photo_upload').css('display')!= 'none') ? true : false;
- },
- accept: "(jpe?g|gif|png)"
- },
- url: {
- required: function() {
- return ($('#photo_url').css('display')!= 'none') ? true : false;
- },
- url: true
- }
- },
- errorElement: "span",
- errorClass: "validate_span",
- errorPlacement: function(label, element) {
- label.prependTo(element.prev())
- }
- });
-
- $("#photo_upload a.linkFrm").click( function() {
- $('#photo_upload').css('display','none');
- $('#photo_url').css('display','block');
- $('#photo').val('');
- return false;
- }
- );
-
- $("#photo_url a.linkFrm").click( function() {
- $('#photo_url').css('display','none');
- $('#photo_upload').css('display','block');
- $('#url').val('');
- return false;
- }
- );
-
- </script>
|