123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
-
-
- <div id="photo_upload">
-
- </div>
-
- <div id="photo_url">
- <label for="description">Photo URL</label>
- <br /><input class="input-text" type="text" name="url" id="url" size="80" value="{editUrl}" />
- </div>
-
- <div>
- <label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
- <br /><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_upload').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>
|